|
| 1 | +name: Test and build |
| 2 | + |
| 3 | +on: [push, pull_request, release] |
| 4 | + |
| 5 | +jobs: |
| 6 | + qa: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + steps: |
| 9 | + - uses: actions/checkout@v4 |
| 10 | + - uses: actions/setup-python@v5 |
| 11 | + with: |
| 12 | + python-version: "3.10" |
| 13 | + - uses: pre-commit/[email protected] |
| 14 | + |
| 15 | + test: |
| 16 | + needs: qa |
| 17 | + runs-on: ${{ matrix.os }} |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + os: [ ubuntu-latest, macos-latest, windows-latest ] |
| 22 | + python-version: [ "3.10", "3.11" ] |
| 23 | + |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + |
| 27 | + - uses: actions/setup-python@v5 |
| 28 | + with: |
| 29 | + python-version: ${{ matrix.python-version }} |
| 30 | + |
| 31 | + - name: Install Poetry |
| 32 | + |
| 33 | + with: |
| 34 | + poetry-version: 1.5.1 |
| 35 | + |
| 36 | + - name: Install dependencies |
| 37 | + run: poetry install |
| 38 | + |
| 39 | + - name: Run tests |
| 40 | + run: poetry run pytest --cov-report xml |
| 41 | + |
| 42 | + - name: Upload coverage to Codecov |
| 43 | + if: (matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10') |
| 44 | + uses: codecov/codecov-action@v4 |
| 45 | + with: |
| 46 | + fail_ci_if_error: true |
| 47 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 48 | + verbose: true |
| 49 | + docs_build: |
| 50 | + needs: qa |
| 51 | + runs-on: ubuntu-latest |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v4 |
| 54 | + - uses: actions/setup-python@v5 |
| 55 | + with: |
| 56 | + python-version: "3.10" |
| 57 | + |
| 58 | + - name: Install Poetry |
| 59 | + |
| 60 | + with: |
| 61 | + poetry-version: 1.5.1 |
| 62 | + |
| 63 | + - name: Install dependencies |
| 64 | + run: poetry install |
| 65 | + |
| 66 | + - name: Set ipython kernel |
| 67 | + run: poetry run python -m ipykernel install --user --name=vr_python3 |
| 68 | + |
| 69 | + - name: Build docs using sphinx |
| 70 | + run: | |
| 71 | + cd docs |
| 72 | + poetry run sphinx-build -W --keep-going source build |
| 73 | + |
| 74 | + - name: Archive built docs for error checking on failure |
| 75 | + if: failure() |
| 76 | + uses: actions/upload-artifact@v3 |
| 77 | + with: |
| 78 | + name: built-docs |
| 79 | + path: docs/build |
| 80 | + retention-days: 2 |
0 commit comments