Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
micpst committed Sep 17, 2024
1 parent 5a0dca7 commit 286a4c9
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4

- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: "0.4.10"

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

Expand All @@ -26,11 +33,13 @@ jobs:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: Install pre-commit
run: pip3 install pre-commit
- name: Install Dependencies
run: source ./setup_dev_env.sh

- name: Run pre-commit checks
run: pre-commit run --all-files --show-diff-on-failure --color always
run: |
source .venv/bin/activate
pre-commit run --all-files --show-diff-on-failure --color always
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
Expand All @@ -57,17 +66,14 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment_tag: trivy

- name: Create venv
run: . ./setup_dev_env.sh

- name: Check licenses
run: |
source venv/bin/activate
source .venv/bin/activate
./check_licenses.sh
- name: Generate pip freeze
run: |
source venv/bin/activate
source .venv/bin/activate
pip freeze > requirements-freeze.txt
- name: Publish Artefacts
Expand All @@ -93,7 +99,7 @@ jobs:

- name: Validate package build
run: |
source venv/bin/activate
source .venv/bin/activate
python -m pip install -U build
for dir in packages/*/; do python -m build "$dir"; done
Expand Down Expand Up @@ -121,6 +127,12 @@ jobs:
- python-version: "3.10"
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: "0.4.10"

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -135,12 +147,12 @@ jobs:
${{ runner.os }}-pip-
- name: Install Dependencies
run: . ./setup_dev_env.sh
run: source ./setup_dev_env.sh

- name: Run Tests With Coverage
run: |
# run with coverage to not execute tests twice
source venv/bin/activate
source .venv/bin/activate
coverage run -m pytest -v -p no:warnings --junitxml=report.xml
coverage report
coverage xml
Expand Down

0 comments on commit 286a4c9

Please sign in to comment.