|
| 1 | +name: CI |
| 2 | + |
| 3 | +# Controls when the action will run. |
| 4 | +on: |
| 5 | + # Triggers the workflow on push or pull request events but only for the master branch |
| 6 | + push: |
| 7 | + branches: [ master ] |
| 8 | + pull_request: |
| 9 | + branches: [ master ] |
| 10 | + |
| 11 | + # Allows you to run this workflow manually from the Actions tab |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +jobs: |
| 15 | + code-quality: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + toxenv: |
| 20 | + - black |
| 21 | + - flake8 |
| 22 | + - mypy |
| 23 | + - isort |
| 24 | + env: |
| 25 | + TOXENV: ${{ matrix.toxenv }} |
| 26 | + |
| 27 | + name: "Tox ${{ matrix.toxenv }}" |
| 28 | + steps: |
| 29 | + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 30 | + - uses: actions/checkout@v4 |
| 31 | + with: |
| 32 | + fetch-depth: 0 |
| 33 | + |
| 34 | + - name: setup python |
| 35 | + uses: actions/setup-python@v5 |
| 36 | + with: |
| 37 | + python-version: '3.13' |
| 38 | + |
| 39 | + - name: Install Requirements [${{ matrix.toxenv }}] |
| 40 | + run: pip install tox |
| 41 | + |
| 42 | + - name: Tox-${{ matrix.toxenv }} |
| 43 | + run: tox |
| 44 | + # This workflow contains a single job called "build" |
| 45 | + test: |
| 46 | + # The type of runner that the job will run on |
| 47 | + runs-on: ubuntu-latest |
| 48 | + strategy: |
| 49 | + matrix: |
| 50 | + toxenv: |
| 51 | + - py39 |
| 52 | + - py310 |
| 53 | + - py311 |
| 54 | + - py312 |
| 55 | + - py313 |
| 56 | + include: |
| 57 | + - toxenv: py39 |
| 58 | + python-version: '3.9' |
| 59 | + - toxenv: py310 |
| 60 | + python-version: '3.10' |
| 61 | + - toxenv: py311 |
| 62 | + python-version: '3.11' |
| 63 | + - toxenv: py312 |
| 64 | + python-version: '3.12' |
| 65 | + - toxenv: py313 |
| 66 | + python-version: '3.13' |
| 67 | + env: |
| 68 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 69 | + TOXENV: ${{ matrix.toxenv }} |
| 70 | + name: "Python ${{ matrix.python-version }} | Tox ${{ matrix.toxenv }}" |
| 71 | + |
| 72 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 73 | + steps: |
| 74 | + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 75 | + - uses: actions/checkout@v4 |
| 76 | + with: |
| 77 | + fetch-depth: 2 |
| 78 | + |
| 79 | + - name: setup python |
| 80 | + uses: actions/setup-python@v5 |
| 81 | + with: |
| 82 | + python-version: ${{ matrix.python-version }} |
| 83 | + |
| 84 | + - name: Install Requirements [Python-${{ matrix.python-version }}] |
| 85 | + run: pip install tox |
| 86 | + |
| 87 | + - name: Tox-${{ matrix.toxenv }} |
| 88 | + run: tox |
| 89 | + |
| 90 | + - name: Upload coverage to Codecov |
| 91 | + uses: codecov/codecov-action@v5 |
| 92 | + with: |
| 93 | + flags: unittests-${{ matrix.python-version }} |
| 94 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 95 | + fail_ci_if_error: true # default = false |
| 96 | + verbose: true # default = false |
0 commit comments