Skip to content

Commit

Permalink
edit github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
autinerd committed Sep 27, 2024
1 parent 784de5b commit f3f2fbe
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python
uses: actions/setup-[email protected]
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
check-latest: true
- name: Create Python virtual environment
run: |
python -m venv venv
. venv/bin/activate
python --version
pip install uv
uv pip install -r requirements.txt
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install the project
run: uv sync --all-extras --dev
- name: Install pre-commit dependencies
run: |
. venv/bin/activate
pre-commit install-hooks
uv run pre-commit install-hooks
- uses: dorny/paths-filter@v3
id: filter
with:
Expand All @@ -38,19 +38,16 @@ jobs:
- name: Run ruff-format
if: steps.filter.outputs.python == 'true'
run: |
. venv/bin/activate
pre-commit run --hook-stage manual ruff-format --all-files --show-diff-on-failure
uv run pre-commit run --hook-stage manual ruff-format --all-files --show-diff-on-failure
env:
RUFF_OUTPUT_FORMAT: github
- name: Run ruff
if: steps.filter.outputs.python == 'true'
run: |
. venv/bin/activate
pre-commit run --hook-stage manual ruff --all-files --show-diff-on-failure
uv run pre-commit run --hook-stage manual ruff --all-files --show-diff-on-failure
env:
RUFF_OUTPUT_FORMAT: github
- name: Validate mapping
if: steps.filter.outputs.mapping_yaml == 'true'
run: |
. venv/bin/activate
pre-commit run --hook-stage manual validate_mapping
uv run pre-commit run --hook-stage manual validate_mapping

0 comments on commit f3f2fbe

Please sign in to comment.