Repository navigation
K13.6: cap demo actions in the database #53
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
| # CI for every push and PR. Roadmap: K0.7 | |
| # Never needs secrets: the app runs in demo mode, contracts are tested in a local sandbox. | |
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| web: | |
| name: Web (typecheck, lint, test, build) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 # version comes from package.json "packageManager" | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm typecheck | |
| - run: pnpm lint | |
| - run: pnpm test | |
| - run: pnpm build | |
| env: | |
| NEXT_TELEMETRY_DISABLED: "1" | |
| e2e: | |
| name: E2E (demo journey, desktop + phone) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm exec playwright install --with-deps chromium | |
| - run: pnpm e2e | |
| env: | |
| NEXT_TELEMETRY_DISABLED: "1" | |
| - uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: playwright-report | |
| path: | | |
| playwright-report | |
| test-results | |
| retention-days: 7 | |
| contracts: | |
| name: Contracts (cargo check + test) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: contracts | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: contracts | |
| # The sandbox tests build the contracts with `cargo near` (near-workspaces compile_project). | |
| - name: Install cargo-near 0.22.0 | |
| # GitHub's release download sometimes answers 504: retry, then build from crates.io instead of failing. | |
| run: | | |
| for attempt in 1 2 3 4 5; do | |
| if curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.22.0/cargo-near-installer.sh | sh; then exit 0; fi | |
| echo "cargo-near download failed (attempt $attempt of 5), retrying in 20 s" | |
| sleep 20 | |
| done | |
| echo "GitHub release download unavailable; building cargo-near 0.22.0 from crates.io instead" | |
| cargo install cargo-near --version 0.22.0 --locked | |
| - run: cargo check --workspace --all-targets | |
| - run: cargo test --workspace | |
| secrets: | |
| name: Secret scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: gitleaks/gitleaks-action@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |