-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3451 from GeotrekCE/dependency_checks
move dependency check in dedicated workflow
- Loading branch information
Showing
3 changed files
with
108 additions
and
38 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Check deps | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- setup.py | ||
- requirements.txt | ||
- requirements-dev.in | ||
- requirements-dev.txt | ||
- .github/workflows/dependencies.yml | ||
|
||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
quality: | ||
name: Checking dependency graph | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: ['ubuntu-20.04'] | ||
python-version: ['3.8'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/pip | ||
~/.wheel_dir | ||
key: ${{ matrix.os }}-pip-${{ matrix.python-version }} | ||
restore-keys: | | ||
${{ matrix.os }}-pip-${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip3 wheel --wheel-dir=~/.wheel_dir pip wheel setuptools | ||
pip3 install --find-links=~/.wheel_dir --upgrade pip wheel setuptools | ||
pip3 wheel --wheel-dir=~/.wheel_dir -r requirements-dev.txt | ||
pip3 install --find-links=~/.wheel_dir --upgrade -r requirements-dev.txt | ||
- name: Check dependency graph | ||
run: | | ||
pip-compile -q | ||
pip-compile -q requirements-dev.in | ||
- name: Verify dependency graph is ok | ||
uses: tj-actions/verify-changed-files@v13 | ||
id: verify-changed-files | ||
with: | ||
files: | | ||
requirements.txt | ||
requirements-dev.txt | ||
- name: Validating graph | ||
if: steps.verify-changed-files.outputs.files_changed == 'true' && github.actor != 'dependabot[bot]' | ||
run: | | ||
echo "Dependency file(s) changed: ${{ steps.verify-changed-files.outputs.changed_files }}" | ||
core.setFailed('Please add your new dependencies in setup.py and/or requirements-dev.in then run pip-compile to add them in requirements. (see docs/contribute/development)') | ||
- name: Dependabot commit dependencies | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
with: | ||
commit_message: Apply dependencies update by dependabot | ||
commit_user_name: dependabot[bot] | ||
commit_user_email: [email protected] | ||
commit_author: dependabot[bot] <[email protected]> |
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
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