chore: completed first Foundry-only page #23613
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: Test | |
| on: [push, pull_request] | |
| # Cancel any in-progress job or run | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| FOUNDRY_PROFILE: ci | |
| NODE_VERSION: '22' | |
| # Set default permissions as restrictive as possible | |
| permissions: | |
| actions: write # Required for upload-artifact | |
| contents: read # Required for checkout and other read operations | |
| checks: write # Required for test results | |
| jobs: | |
| # Setup job to install and cache dependencies | |
| setup: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@c5ba7f7862a0f64c1b1a05fbac13e0b8e86ba08c | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Cache node_modules | |
| uses: actions/cache@v4 | |
| id: cache-node-modules | |
| continue-on-error: true | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| - name: Install Dependencies | |
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
| run: | | |
| echo "Cache miss, installing dependencies..." | |
| pnpm install --prefer-offline | |
| # Job 1: Check Solidity Compilation and Solhint | |
| solidity: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@c5ba7f7862a0f64c1b1a05fbac13e0b8e86ba08c | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@50d5a8956f2e319df19e6b57539d7e2acb9f8c1e # v1.5 | |
| with: | |
| version: stable | |
| cache: false | |
| - name: Show Forge version | |
| run: forge --version | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Check Solidity Formatting | |
| run: pnpm run sol:fmt:check | |
| - name: Check Solidity Compilation | |
| run: pnpm run sol:compile | |
| - name: Check Solidity Linting | |
| run: pnpm run lint-solc | |
| # Job 2: Check ESLint | |
| eslint: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@c5ba7f7862a0f64c1b1a05fbac13e0b8e86ba08c | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Check ESLint | |
| run: | | |
| echo "Running ESLint with cache..." | |
| pnpm exec eslint . --cache --cache-strategy content | |
| - name: Check Formatting | |
| run: | | |
| echo "Running Prettier with cache..." | |
| pnpm exec prettier --check . --cache | |
| # Job 3: Check Internal Links | |
| linkcheck-internal: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@c5ba7f7862a0f64c1b1a05fbac13e0b8e86ba08c | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Site | |
| run: pnpm run build | |
| env: | |
| NODE_OPTIONS: '--max-old-space-size=8192' | |
| - name: Check Internal Links | |
| uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2.7.0 | |
| with: | |
| args: >- | |
| --root-dir $GITHUB_WORKSPACE/.vercel/output/static | |
| --config lychee.toml | |
| '.vercel/output/static/**/*.html' | |
| fail: true | |
| format: markdown | |
| jobSummary: true | |
| # Job 4: Check Types | |
| typecheck: | |
| needs: [setup] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@c5ba7f7862a0f64c1b1a05fbac13e0b8e86ba08c | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Generate Astro types | |
| run: | | |
| echo "Generating Astro types..." | |
| pnpm run astro sync | |
| - name: Check Types | |
| run: | | |
| echo "Running type check..." | |
| pnpm run typecheck | |
| # Job 5: Run Jest Tests | |
| jest: | |
| needs: [setup] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@c5ba7f7862a0f64c1b1a05fbac13e0b8e86ba08c | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Jest Tests | |
| run: pnpm test -- --coverage | |
| - name: Upload Test Coverage | |
| if: always() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 | |
| with: | |
| name: coverage-report-node-${{ env.NODE_VERSION }} | |
| path: coverage/ | |
| retention-days: 30 |