ci.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Continuous integration
  2. on:
  3. push:
  4. pull_request:
  5. concurrency:
  6. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}
  7. cancel-in-progress: true
  8. jobs:
  9. build:
  10. runs-on: ubuntu-24.04
  11. timeout-minutes: 120
  12. steps:
  13. - name: Checkout
  14. uses: actions/checkout@v4
  15. - name: Style checks via pre-commit
  16. uses: pre-commit/[email protected]
  17. - name: Custom RST checks (check-rst.sh)
  18. run: |
  19. bash ./_tools/check-rst.sh
  20. - name: Get Python version
  21. id: pythonv
  22. run: |
  23. echo "PYTHON_VERSION=$(python --version)" >> $GITHUB_OUTPUT
  24. - name: Restore cached virtualenv
  25. uses: actions/cache/restore@v4
  26. with:
  27. key: venv-${{ runner.os }}-${{ steps.pythonv.outputs.PYTHON_VERSION }}-${{ hashFiles('requirements.txt') }}
  28. path: .venv
  29. - name: Install dependencies
  30. run: |
  31. python -m venv .venv
  32. source .venv/bin/activate
  33. python -m pip install -r requirements.txt
  34. echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
  35. echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
  36. - name: Save virtualenv cache
  37. uses: actions/cache/save@v4
  38. with:
  39. key: venv-${{ runner.os }}-${{ steps.pythonv.outputs.PYTHON_VERSION }}-${{ hashFiles('requirements.txt') }}
  40. path: .venv
  41. # Use dummy builder to improve performance as we don't need the generated HTML in this workflow.
  42. - name: Sphinx build
  43. run: |
  44. source .venv/bin/activate
  45. make SPHINXOPTS='--color -j 4 -W' dummy