Skip to content

Commit

Permalink
ci: Update ci.yml to add Python version to uv cache
Browse files Browse the repository at this point in the history
  • Loading branch information
MountainGod2 committed Nov 1, 2024
1 parent 7ab1265 commit e13ae8d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ on:
push:
branches:
- main
tags-ignore:
- '*'
pull_request:
branches:
- main

env:
UV_CACHE_DIR: /tmp/.uv-cache
UV_CACHE_DIR: /tmp/.uv-cache-${{ matrix.python-version }}

jobs:
ci:
Expand Down Expand Up @@ -37,10 +39,9 @@ jobs:
uses: actions/[email protected]
with:
path: ${{ env.UV_CACHE_DIR }}
key: "uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}"
key: "uv-${{ matrix.python-version }}-${{ runner.os }}-${{ hashFiles('uv.lock') }}"
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
uv-${{ matrix.python-version }}-${{ runner.os }}
- name: Install Dependencies and Sync Project
run: uv sync
Expand All @@ -53,16 +54,17 @@ jobs:
uv run pytest ./
- name: Scan with SonarCloud
if: matrix.python-version == '3.11'
uses: SonarSource/[email protected]
env:
SONAR_TOKEN: '${{ secrets.SONAR_TOKEN }}'

- name: Upload Test Coverage to Codecov
if: success()
if: success() && matrix.python-version == '3.11'
uses: codecov/[email protected]
with:
token: '${{ secrets.CODECOV_TOKEN }}'
file: ./coverage.xml
file: ./coverage-3.11.xml
fail_ci_if_error: true

- name: Build Documentation
Expand Down

0 comments on commit e13ae8d

Please sign in to comment.