tadashi-aikawa/owlmixin

View on GitHub
.github/workflows/tests.yaml

Summary

Maintainability
Test Coverage
name: "Tests"

on:
  push:
    paths:
      - ".github/**/*"
      - "owlmixin/*"
      - "owlmixin/**/*"
      - "tests/*"
      - "tests/**/*"
      - "poetry.lock"
      - ".codeclimate.yml"
  pull_request:
    branches:
      - master
  schedule:
    - cron: "0 0 * * *"

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
    name: Python ${{ matrix.python }} on ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python }}

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip poetry
          poetry install

      - run: make test
      - uses: codecov/codecov-action@v1
        if: matrix.python == 3.10 && matrix.os == 'ubuntu-latest' && success()

      - name: "Discord notification (not success)"
        uses: rjstone/discord-webhook-notify@v1
        if: "! success()"
        with:
          description: "⚠ Owlmixin Tests failed!"
          footer: "Python v${{ matrix.python }} on ${{ matrix.os }})"
          severity: error
          avatarUrl: https://www.suruga-ya.jp/database/pics_light/game/871005085.jpg
          webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}

  notify:
    needs: test
    runs-on: ubuntu-latest

    steps:
      - name: "Discord notification (success)"
        uses: rjstone/discord-webhook-notify@v1
        if: always()
        with:
          description: "✅ Owlmixin Tests passed!"
          footer: "Python v3.7/3.8/3.9/3.10/3.11"
          severity: info
          avatarUrl: https://www.suruga-ya.jp/database/pics_light/game/871005085.jpg
          webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}