-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Update CI workflow for code quality checks and documentatio…
…n build
- Loading branch information
1 parent
9b9f24b
commit 432606e
Showing
1 changed file
with
14 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,67 +12,65 @@ on: | |
|
||
jobs: | ||
ci: | ||
name: Run Tests, Linting, and Build Documentation | ||
name: CI - Code Quality and Documentation Build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.11, 3.12, 3.13] | ||
fail-fast: true | ||
timeout-minutes: 20 | ||
env: | ||
UV_CACHE_DIR: /tmp/uv-cache-${{ matrix.python-version }} | ||
|
||
steps: | ||
- name: Checkout Repository | ||
- name: Setup | Checkout Repository | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Set up UV Environment | ||
- name: Setup | UV Environment | ||
uses: astral-sh/[email protected] | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: uv.lock | ||
|
||
- name: Restore UV Cache | ||
- name: Cache UV Dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: /tmp/.uv-cache-${{ matrix.python-version }} | ||
path: ${{ env.UV_CACHE_DIR }} | ||
key: "uv-${{ matrix.python-version }}-${{ runner.os }}-${{ hashFiles('uv.lock') }}" | ||
restore-keys: | | ||
uv-${{ matrix.python-version }}-${{ runner.os }} | ||
- name: Install Dependencies and Sync Project | ||
env: | ||
UV_CACHE_DIR: /tmp/.uv-cache-${{ matrix.python-version }} | ||
- name: Install and Sync Dependencies | ||
run: uv sync | ||
|
||
- name: Run Formatting, Linting, Type Checks, and Tests | ||
env: | ||
UV_CACHE_DIR: /tmp/.uv-cache-${{ matrix.python-version }} | ||
- name: Run Code Quality Checks (Formatting, Linting, Type Checks, Tests) | ||
run: | | ||
uv run ruff format ./ | ||
uv run ruff check --fix ./ | ||
uv run mypy ./ | ||
uv run pytest ./ | ||
- name: Build Documentation | ||
env: | ||
UV_CACHE_DIR: /tmp/.uv-cache-${{ matrix.python-version }} | ||
if: matrix.python-version == '3.11' | ||
run: uv run --group=docs make clean html --directory docs/ | ||
|
||
- name: Upload Documentation to GitHub Pages | ||
- name: Deploy Documentation to GitHub Pages | ||
if: success() && matrix.python-version == '3.11' | ||
uses: peaceiris/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: docs/_build/html | ||
|
||
- name: Scan with SonarCloud | ||
- name: Scan Codebase with SonarCloud | ||
if: matrix.python-version == '3.11' | ||
uses: SonarSource/[email protected] | ||
env: | ||
SONAR_TOKEN: '${{ secrets.SONAR_TOKEN }}' | ||
|
||
- name: Upload Test Coverage to Codecov | ||
- name: Upload Test Coverage Report to Codecov | ||
if: success() && matrix.python-version == '3.11' | ||
uses: codecov/[email protected] | ||
with: | ||
|
@@ -81,6 +79,4 @@ jobs: | |
fail_ci_if_error: true | ||
|
||
- name: Minimize UV Cache | ||
env: | ||
UV_CACHE_DIR: /tmp/.uv-cache-${{ matrix.python-version }} | ||
run: uv cache prune --ci |