Fix ERT hook workflow (#399) #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test & Lint | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
schedule: | |
# Run CI every night and check that tests are working with latest dependencies | |
- cron: '0 0 * * *' | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11'] | |
env: | |
PYTHONPATH: ${{ github.workspace }}/install/lib/python${{ matrix.python-version }}/site-packages:${{ github.workspace }}/install/lib/python${{ matrix.python-version }}/dist-packages | |
steps: | |
- name: Checkout commit locally | |
uses: actions/checkout@v3 | |
- name: Checkout tags | |
# This seems necessary for setuptools_scm to be able to infer | |
# the correct version. | |
run: git fetch --unshallow --tags | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install subscript-internal with dependencies | |
run: | | |
pip install --upgrade pip | |
pip install .[tests,docs] | |
- name: List all installed packages | |
run: pip freeze | |
- name: Install pre-commit | |
run: pip install pre-commit | |
- name: Run pre-commit | |
run: | | |
SKIP="sphinx-build,no-commit-to-branch" pre-commit run --all-files | |
- name: Run tests | |
run: | | |
python -c "import subscript_internal" | |
pytest tests/ | |
- name: Build documentation | |
run: | | |
sphinx-build -b html -nv docs/ build/docs | |
sphinx-apidoc -H "API for subscript-internal" -o docs src | |
python setup.py build_sphinx |