⬆️ Update Node Dependencies #477
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: PR Quality Gate | |
| on: | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: {} | |
| concurrency: | |
| group: pr-quality-gate-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| rust-fast-gate: | |
| name: Rust Fast Gate | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Build and verify frontend | |
| uses: ./.github/actions/build-frontend | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Restore trusted debug Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: v1-lynx-rust | |
| shared-key: debug | |
| cache-targets: true | |
| cache-bin: false | |
| save-if: false | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Run clippy | |
| run: cargo clippy --all-features -- -D warnings -A clippy::too_many_arguments | |
| - name: Run unit tests | |
| run: cargo test | |
| rust-integration-sqlite: | |
| name: Rust Integration Tests (SQLite) | |
| runs-on: ubuntu-24.04 | |
| needs: rust-fast-gate | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Build and verify frontend | |
| uses: ./.github/actions/build-frontend | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Restore trusted debug Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: v1-lynx-rust | |
| shared-key: debug | |
| cache-targets: true | |
| cache-bin: false | |
| save-if: false | |
| - name: Run SQLite integration tests | |
| run: DATABASE_BACKEND=sqlite cargo test --tests | |
| env: | |
| RUST_LOG: info | |
| rust-integration-postgres: | |
| name: Rust Integration Tests (PostgreSQL) | |
| runs-on: ubuntu-24.04 | |
| needs: rust-fast-gate | |
| permissions: | |
| contents: read | |
| env: | |
| DATABASE_URL: postgresql://lynx:lynx_password@localhost:5432/lynx | |
| services: | |
| postgres: | |
| image: postgres:18-alpine | |
| env: | |
| POSTGRES_USER: lynx | |
| POSTGRES_PASSWORD: lynx_password | |
| POSTGRES_DB: lynx | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Build and verify frontend | |
| uses: ./.github/actions/build-frontend | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Restore trusted debug Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: v1-lynx-rust | |
| shared-key: debug | |
| cache-targets: true | |
| cache-bin: false | |
| save-if: false | |
| - name: Run PostgreSQL integration tests | |
| run: DATABASE_BACKEND=postgres cargo test --tests | |
| env: | |
| RUST_LOG: info | |
| build-docker-image: | |
| name: Build Docker Image | |
| runs-on: ubuntu-24.04 | |
| needs: rust-fast-gate | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - name: Build and verify frontend | |
| uses: ./.github/actions/build-frontend | |
| - uses: docker/setup-buildx-action@v4 | |
| - name: Build Docker image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: false | |
| load: true | |
| tags: lynx-pr:${{ github.sha }} | |
| cache-from: type=gha,scope=lynx-docker-amd64 | |
| - name: Upload Docker image | |
| run: docker save lynx-pr:${{ github.sha }} -o /tmp/lynx-pr-image.tar | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: lynx-pr-image | |
| path: /tmp/lynx-pr-image.tar | |
| retention-days: 1 | |
| e2e-sqlite: | |
| name: External Harness (SQLite) | |
| runs-on: ubuntu-24.04 | |
| needs: build-docker-image | |
| permissions: | |
| contents: read | |
| env: | |
| DATABASE_URL: sqlite:///home/lynx/lynx.db | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: lynx-pr-image | |
| path: /tmp | |
| - name: Load Docker image | |
| run: docker load -i /tmp/lynx-pr-image.tar | |
| - name: Build and verify frontend | |
| uses: ./.github/actions/build-frontend | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Restore trusted debug Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: v1-lynx-rust | |
| shared-key: debug | |
| cache-targets: true | |
| cache-bin: false | |
| save-if: false | |
| - name: Start Lynx container | |
| run: | | |
| docker run --detach --name lynx \ | |
| --publish 8080:8080 --publish 3000:3000 \ | |
| --env DATABASE_BACKEND=sqlite --env DATABASE_URL \ | |
| --env RUST_LOG=info \ | |
| --env AUTH_MODE=none \ | |
| --env ANALYTICS_ENABLED=true --env ANALYTICS_FLUSH_INTERVAL_SECS=1 \ | |
| --env API_HOST=0.0.0.0 --env API_PORT=8080 \ | |
| --env REDIRECT_HOST=0.0.0.0 --env REDIRECT_PORT=3000 \ | |
| lynx-pr:${{ github.sha }} | |
| - name: Run typed external scenarios | |
| run: cargo test --test external_harness -- --ignored --test-threads=1 --nocapture | |
| env: | |
| LYNX_E2E_CONTAINER: lynx | |
| LYNX_E2E_CONCURRENCY: '100' | |
| LYNX_E2E_EXPECT_ANALYTICS: 'true' | |
| RUST_LOG: info | |
| - name: Collect service logs | |
| if: always() | |
| run: docker logs lynx || true | |
| - name: Clean up service | |
| if: always() | |
| run: docker rm --force lynx || true | |
| e2e-postgres: | |
| name: External Harness (PostgreSQL) | |
| runs-on: ubuntu-24.04 | |
| needs: build-docker-image | |
| permissions: | |
| contents: read | |
| env: | |
| DATABASE_URL: postgresql://lynx:lynx_password@localhost:5432/lynx | |
| services: | |
| postgres: | |
| image: postgres:18-alpine | |
| env: | |
| POSTGRES_USER: lynx | |
| POSTGRES_PASSWORD: lynx_password | |
| POSTGRES_DB: lynx | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: lynx-pr-image | |
| path: /tmp | |
| - name: Load Docker image | |
| run: docker load -i /tmp/lynx-pr-image.tar | |
| - name: Build and verify frontend | |
| uses: ./.github/actions/build-frontend | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Restore trusted debug Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: v1-lynx-rust | |
| shared-key: debug | |
| cache-targets: true | |
| cache-bin: false | |
| save-if: false | |
| - name: Start Lynx container | |
| run: | | |
| docker run --detach --name lynx --network host \ | |
| --env DATABASE_BACKEND=postgres --env DATABASE_URL \ | |
| --env RUST_LOG=info \ | |
| --env AUTH_MODE=none \ | |
| --env ANALYTICS_ENABLED=true --env ANALYTICS_FLUSH_INTERVAL_SECS=1 \ | |
| --env API_HOST=0.0.0.0 --env API_PORT=8080 \ | |
| --env REDIRECT_HOST=0.0.0.0 --env REDIRECT_PORT=3000 \ | |
| lynx-pr:${{ github.sha }} | |
| - name: Run typed external scenarios | |
| run: cargo test --test external_harness -- --ignored --test-threads=1 --nocapture | |
| env: | |
| LYNX_E2E_CONTAINER: lynx | |
| LYNX_E2E_CONCURRENCY: '100' | |
| LYNX_E2E_EXPECT_ANALYTICS: 'true' | |
| RUST_LOG: info | |
| - name: Collect service logs | |
| if: always() | |
| run: docker logs lynx || true | |
| - name: Clean up service | |
| if: always() | |
| run: docker rm --force lynx || true |