-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
6 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 |
---|---|---|
|
@@ -50,4 +50,4 @@ jobs: | |
shell: bash | ||
run: poetry check --lock | ||
|
||
- uses: pre-commit/[email protected].0 | ||
- uses: pre-commit/[email protected].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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
|
||
name: Safety hook | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
runner-job: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
|
||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Bootstrap poetry | ||
shell: bash | ||
run: | | ||
python -m ensurepip | ||
python -m pip install --upgrade pip | ||
python -m pip install poetry | ||
- name: Configure poetry | ||
shell: bash | ||
run: | | ||
python -m poetry config virtualenvs.in-project true | ||
- name: Set up cache | ||
uses: actions/cache@v3 | ||
id: cache | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: | | ||
python -m poetry install --all-extras | ||
- name: Check poetry.lock consistency | ||
shell: bash | ||
run: poetry check --lock | ||
|
||
- uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --config .pre-commit-safety.yaml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: safety | ||
name: Safety | ||
entry: poetry run safety check --full-report | ||
pass_filenames: false | ||
language: system |