Skip to content

Commit

Permalink
👷 Simplify and use mise for workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ff137 committed Dec 11, 2024
1 parent 2c04b4f commit 570b511
Showing 1 changed file with 37 additions and 5 deletions.
42 changes: 37 additions & 5 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,37 @@ jobs:
with:
fetch-depth: 0 # Required for proper blame data in SonarCloud

# Setup Python
- name: Setup Python
uses: actions/setup-python@v2
- name: Overwrite .mise.toml # Simplify mise in this workflow
run: |
cat <<EOF > .mise.toml
[tools]
python = "3.12"
"pipx:poetry" = "1.8"
uv = "0.4"
[settings]
experimental = true
jobs = 1
pipx_uvx = true
python_compile = false
[env]
# Use Python/Mise managed virtual environment
POETRY_VIRTUALENVS_CREATE = "false"
# Setup Python Virtual Environment
_.python.venv = { path = ".venv", create = true }
[tasks."poetry:install"]
description = "Poetry Install dependencies for all submodules"
depends = ["poetry:install:*"]
EOF
- name: Install dependencies
uses: jdx/mise-action@v2
with:
python-version: "3.12"
cache: true
experimental: true
install: true

# Install dependencies
- name: Install dependencies with Poetry
Expand All @@ -62,7 +88,13 @@ jobs:
# Run tests and generate coverage report
- name: Run Tests with Coverage
run: |
pytest --cov --cov-report=xml --ignore=app/tests/e2e/ --ignore=trustregistry/tests/e2e/
source .venv/bin/activate
set +e
cp .env.example .env
source .env
poetry run pytest --cov --cov-report=xml --ignore=app/tests/e2e/ --ignore=trustregistry/tests/e2e/
# Analyze with SonarCloud
- name: Analyze with SonarCloud
Expand Down

0 comments on commit 570b511

Please sign in to comment.