upgrade CI GHA #23
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: Full Stack CI | |
| on: | |
| push: | |
| branches: [ "1.0.4" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| # Backend Rust tests | |
| rust-tests: | |
| name: Rust Backend Tests | |
| runs-on: macos-latest | |
| steps: | |
| - name: Fetch Repository | |
| uses: actions/checkout@v4 | |
| - name: Install stable Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| target: x86_64-unknown-linux-gnu | |
| - name: Cache Cargo dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| src-tauri/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Run Rust tests | |
| run: | | |
| cd src-tauri | |
| cargo test --verbose | |
| - name: Check Rust formatting | |
| run: | | |
| cd src-tauri | |
| cargo fmt --all -- --check | |
| # Frontend tests | |
| frontend-tests: | |
| name: Frontend Tests | |
| runs-on: macos-latest | |
| steps: | |
| - name: Fetch Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Cache pnpm dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pnpm-store | |
| node_modules | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run frontend tests | |
| run: pnpm test | |
| env: | |
| NODE_ENV: test | |
| # Security and quality checks | |
| security-checks: | |
| name: Security & Quality Checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fetch Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run frontend security audit | |
| run: pnpm audit | |
| continue-on-error: true | |
| - name: Run Rust security audit | |
| run: | | |
| cargo install cargo-audit | |
| cd src-tauri | |
| cargo audit | |
| continue-on-error: true | |
| - name: Check for outdated dependencies | |
| run: | | |
| pnpm outdated | |
| cd src-tauri | |
| cargo outdated | |
| continue-on-error: true |