Add per-action health metrics to executor (#191) #502
This file contains hidden or 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
| name: Code Quality Checks | |
| on: | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| python-quality: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: ".python-version" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "latest" | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync --dev | |
| - name: Set PY | |
| run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} | |
| - name: Run pre-commit python checks (ruff, mypy, etc.) | |
| env: | |
| SKIP: prettier-osprey-ui | |
| run: | | |
| uv run pre-commit install --install-hooks | |
| uv run pre-commit run --show-diff-on-failure --color=always --all-files | |
| - name: Check for unused dependencies | |
| run: uv tool run fawltydeps --check-unused --pyenv .venv | |
| ui-quality: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "18" | |
| cache: "npm" | |
| cache-dependency-path: osprey_ui/package-lock.json | |
| - name: Install UI dependencies | |
| run: npm ci | |
| working-directory: osprey_ui | |
| - name: Run prettier check | |
| run: npm run format:check | |
| working-directory: osprey_ui | |
| rust-quality: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| override: true | |
| - name: Cache Rust dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| osprey_coordinator/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('osprey_coordinator/Cargo.lock', 'osprey_coordinator/Cargo.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Check Rust formatting | |
| run: cargo fmt --check | |
| working-directory: osprey_coordinator | |
| - name: Run Clippy linting | |
| run: cargo clippy -- -D warnings | |
| working-directory: osprey_coordinator | |
| continue-on-error: true | |
| - name: Build Rust project | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler | |
| cargo build --verbose | |
| working-directory: osprey_coordinator | |
| - name: Run Rust tests | |
| run: cargo test --verbose | |
| working-directory: osprey_coordinator | |
| continue-on-error: true |