From 286a4c94c3670b3da059b3a1347ba358a317d23c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pstr=C4=85g?= Date: Tue, 17 Sep 2024 10:37:46 +0200 Subject: [PATCH] update ci --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ea6ddf7..5eeeacb0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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" @@ -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 @@ -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 @@ -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 @@ -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: @@ -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