ci.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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/action@v3.0.1
  17. - name: Get Python version
  18. id: pythonv
  19. run: |
  20. echo "PYTHON_VERSION=$(python --version)" >> $GITHUB_OUTPUT
  21. - name: Restore cached virtualenv
  22. uses: actions/cache/restore@v4
  23. with:
  24. key: venv-${{ runner.os }}-${{ steps.pythonv.outputs.PYTHON_VERSION }}-${{ hashFiles('requirements.txt') }}
  25. path: .venv
  26. - name: Install dependencies
  27. run: |
  28. python -m venv .venv
  29. source .venv/bin/activate
  30. python -m pip install -r requirements.txt
  31. echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
  32. echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
  33. - name: Save virtualenv cache
  34. uses: actions/cache/save@v4
  35. with:
  36. key: venv-${{ runner.os }}-${{ steps.pythonv.outputs.PYTHON_VERSION }}-${{ hashFiles('requirements.txt') }}
  37. path: .venv
  38. # Use dummy builder to improve performance as we don't need the generated HTML in this workflow.
  39. - name: Sphinx build
  40. run: |
  41. source .venv/bin/activate
  42. make SPHINXOPTS='--color -j 4 -W' dummy