Insurance #71
Workflow file for this run
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint-format-ts: | |
| name: TypeScript Lint & Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - run: npm ci | |
| - name: ESLint | |
| run: npm run lint --workspaces --if-present | |
| - name: Prettier check | |
| run: npx prettier --check "**/*.{ts,tsx,js,svelte,json,css}" | |
| lint-format-rust: | |
| name: Rust Lint & Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: swatinem/rust-cache@v2 | |
| - name: rustfmt | |
| run: cargo fmt --all -- --check | |
| - name: clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| security-scan: | |
| name: Security Scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - run: npm ci | |
| - name: npm audit | |
| run: npm audit --audit-level=high | |
| - name: cargo-audit | |
| uses: rustsec/audit-check@v1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Trivy vulnerability scan | |
| uses: aquasecurity/trivy-action@master | |
| with: | |
| scan-type: fs | |
| scan-ref: . | |
| severity: HIGH,CRITICAL | |
| exit-code: 1 | |
| quality-gate: | |
| name: Quality Gate | |
| runs-on: ubuntu-latest | |
| needs: [lint-format-ts, lint-format-rust, security-scan] | |
| steps: | |
| - name: All checks passed | |
| run: echo "✅ Code quality gate passed" |