Dependencies #31
This file contains hidden or 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: Dependencies | |
| on: | |
| # Warning: this workflow must not be triggered by push or pull_request to avoid infinite loops! | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '47 8 19 * *' | |
| push: | |
| branches: | |
| - dev | |
| paths: | |
| - '.github/workflows/dependencies.yaml' | |
| - 'requirements/*.in' | |
| permissions: | |
| pull-requests: write | |
| # Note: DEPENDENCY_WORKFLOW_KEY is used, such that CI will be triggered on push | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| env: | |
| # Note: the last version in this list is used to for sphinx-docs and pypi-releases | |
| PYTHON_VERSIONS: | | |
| 3.9 | |
| 3.10 | |
| 3.11 | |
| 3.13 | |
| 3.12 | |
| jobs: | |
| update-dependencies: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: dev # force checkout dev branch since schedule runs on main by default | |
| ssh-key: ${{ secrets.DEPENDENCY_WORKFLOW_KEY }} | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSIONS }} | |
| - name: Update dependencies | |
| run: | | |
| cd requirements | |
| for VER in $PYTHON_VERSIONS | |
| do | |
| echo "::group::Updating dependencies for python $VER..." | |
| python$VER -m pip install pip-tools==7.4.1 | |
| python$VER -m piptools compile --upgrade --no-annotate -o examples-requirements-py$VER.txt --all-extras ../pyproject.toml examples.in | |
| python$VER -m piptools compile --upgrade --no-annotate -o tests-requirements-py$VER.txt examples-requirements-py$VER.txt tests.in | |
| echo "::endgroup::" | |
| done | |
| # use last version for docs and releases | |
| echo "::group::Updating dependencies for docs and release using python $VER..." | |
| echo "$VER" > .python-version | |
| python$VER -m piptools compile --upgrade --no-annotate -o docs-requirements.txt examples-requirements-py$VER.txt docs.in | |
| echo "::endgroup::" | |
| - name: Open PR | |
| uses: peter-evans/[email protected] | |
| with: | |
| commit-message: Dependency updates | |
| author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
| branch: deps/dependency-updates | |
| base: dev | |
| delete-branch: true | |
| title: Dependency updates | |
| labels: | | |
| dependencies | |
| body: | | |
| Dependency updates by pip-compile |