|
| 1 | +# This workflow will install Python dependencies, run tests across multiple |
| 2 | +# Python versions, and lints things with a single version of Python. |
| 3 | +# For more information see: |
| 4 | +# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 5 | +--- |
| 6 | +name: CI |
| 7 | + |
| 8 | +on: # yamllint disable-line rule:truthy |
| 9 | + push: |
| 10 | + branches: |
| 11 | + - "master" |
| 12 | + pull_request: |
| 13 | + branches: |
| 14 | + - "*" |
| 15 | + |
| 16 | +jobs: |
| 17 | + tests: |
| 18 | + runs-on: ubuntu-20.04 |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] |
| 23 | + allowed-to-fail: [false] |
| 24 | + include: |
| 25 | + - python-version: "3.12" |
| 26 | + allowed-to-fail: true |
| 27 | + - python-version: "3.13" |
| 28 | + allowed-to-fail: true |
| 29 | + name: "Build and Test: Python ${{ matrix.python-version }}" |
| 30 | + steps: |
| 31 | + - name: Checkout |
| 32 | + uses: actions/checkout@v4 |
| 33 | + |
| 34 | + - name: "Set up Python ${{ matrix.python-version }}" |
| 35 | + uses: actions/setup-python@v4 |
| 36 | + continue-on-error: ${{ matrix.allowed-to-fail }} |
| 37 | + with: |
| 38 | + python-version: "${{ matrix.python-version }}" |
| 39 | + |
| 40 | + - name: Install dependencies |
| 41 | + continue-on-error: ${{ matrix.allowed-to-fail }} |
| 42 | + run: | |
| 43 | + pip install -r requirements-dev.txt |
| 44 | + pip install -e . |
| 45 | +
|
| 46 | + - name: Run tests |
| 47 | + continue-on-error: ${{ matrix.allowed-to-fail }} |
| 48 | + run: | |
| 49 | + pytest |
| 50 | +
|
| 51 | + # A summary of all jobs and their result. |
| 52 | + # This is the only job that's required to pass (as set by branch protection |
| 53 | + # rules in repo settings) so that we don't have to update those rules when |
| 54 | + # a new job is added. |
| 55 | + check-all-jobs: |
| 56 | + if: always() |
| 57 | + needs: |
| 58 | + - tests |
| 59 | + # - lint |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - name: Check status of all jobs. |
| 63 | + |
| 64 | + with: |
| 65 | + jobs: ${{ toJSON(needs) }} |
0 commit comments