feat: enrich projects and goals display #28
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: CI | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| # ──────────────────────────────────────────────── | |
| # Job 1: Formatting | |
| # ──────────────────────────────────────────────── | |
| fmt: | |
| name: Formatting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| # ──────────────────────────────────────────────── | |
| # Job 2: Clippy (cross-platform) | |
| # ──────────────────────────────────────────────── | |
| clippy: | |
| name: Clippy (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| # ──────────────────────────────────────────────── | |
| # Job 3: Tests (cross-platform) | |
| # ──────────────────────────────────────────────── | |
| test: | |
| name: Tests (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@nextest | |
| - name: Run tests | |
| run: cargo nextest run --all-features | |
| - name: Run doc tests | |
| run: cargo test --doc --all-features | |
| # ──────────────────────────────────────────────── | |
| # Job 4: Documentation | |
| # ──────────────────────────────────────────────── | |
| docs: | |
| name: Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check documentation | |
| env: | |
| RUSTDOCFLAGS: "-D warnings" | |
| run: cargo doc --no-deps --all-features | |
| # ──────────────────────────────────────────────── | |
| # Job 5: Release build check | |
| # ──────────────────────────────────────────────── | |
| build-release: | |
| name: Release Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build in release mode | |
| run: cargo build --release | |
| - name: Check binary size | |
| run: | | |
| SIZE=$(stat -c%s target/release/waka 2>/dev/null || stat -f%z target/release/waka) | |
| echo "Binary size: $(numfmt --to=iec-i --suffix=B $SIZE 2>/dev/null || echo "${SIZE} bytes")" | |
| # Warn if over 15MB (informational only) | |
| if [ "$SIZE" -gt 15728640 ]; then | |
| echo "::warning::Binary size exceeds 15MB — consider investigating" | |
| fi | |
| # ──────────────────────────────────────────────── | |
| # Job 6: MSRV Check (1.88.0) | |
| # ──────────────────────────────────────────────── | |
| msrv: | |
| name: MSRV (1.88.0) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: "1.88.0" | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check MSRV compatibility | |
| run: cargo check --all-features | |
| # ──────────────────────────────────────────────── | |
| # Job 7: Coverage (main branch only) | |
| # ──────────────────────────────────────────────── | |
| coverage: | |
| name: Coverage | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: llvm-tools-preview | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@nextest | |
| - name: Generate coverage report | |
| run: cargo llvm-cov nextest --all-features --lcov --output-path lcov.info | |
| - name: Upload to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: lcov.info | |
| fail_ci_if_error: false | |
| # ──────────────────────────────────────────────── | |
| # Status Gate — all jobs must pass | |
| # ──────────────────────────────────────────────── | |
| ci-success: | |
| name: CI Success | |
| needs: [fmt, clippy, test, docs, build-release, msrv] | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Check all jobs passed | |
| env: | |
| FMT: ${{ needs.fmt.result }} | |
| CLIPPY: ${{ needs.clippy.result }} | |
| TEST: ${{ needs.test.result }} | |
| DOCS: ${{ needs.docs.result }} | |
| BUILD: ${{ needs.build-release.result }} | |
| MSRV: ${{ needs.msrv.result }} | |
| run: | | |
| echo "fmt: $FMT" | |
| echo "clippy: $CLIPPY" | |
| echo "test: $TEST" | |
| echo "docs: $DOCS" | |
| echo "build: $BUILD" | |
| echo "msrv: $MSRV" | |
| if [ "$FMT" != "success" ] || \ | |
| [ "$CLIPPY" != "success" ] || \ | |
| [ "$TEST" != "success" ] || \ | |
| [ "$DOCS" != "success" ] || \ | |
| [ "$BUILD" != "success" ] || \ | |
| [ "$MSRV" != "success" ]; then | |
| echo "One or more CI jobs failed" | |
| exit 1 | |
| fi | |
| echo "All CI jobs passed ✓" |