Read job skip conditions #72
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: CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| install: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - name: Cache pnpm store | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.pnpm-store | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Cache node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-modules- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: install | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - name: Restore node_modules cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-modules- | |
| - name: Install dependencies (if cache miss) | |
| run: pnpm install --frozen-lockfile | |
| - name: Run build | |
| run: pnpm run build | |
| - name: Cache build artifacts | |
| uses: actions/cache@v4 | |
| with: | |
| path: dist | |
| key: ${{ runner.os }}-build-${{ github.sha }} | |
| lint: | |
| runs-on: ubuntu-latest | |
| needs: install | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - name: Restore node_modules cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-modules- | |
| - name: Install dependencies (if cache miss) | |
| run: pnpm install --frozen-lockfile | |
| - name: Run lint | |
| run: pnpm run lint | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: [install, build] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - name: Restore node_modules cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-modules- | |
| - name: Restore build artifacts | |
| uses: actions/cache@v4 | |
| with: | |
| path: dist | |
| key: ${{ runner.os }}-build-${{ github.sha }} | |
| - name: Install dependencies (if cache miss) | |
| run: pnpm install --frozen-lockfile | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| with: | |
| version: nightly | |
| - name: Start Anvil | |
| run: | | |
| anvil --host 0.0.0.0 --accounts 10 --balance 1000 & | |
| # Wait for Anvil to be ready by checking if it responds to requests | |
| echo "Waiting for Anvil to be ready..." | |
| for i in {1..30}; do | |
| if curl -s -X POST -H "Content-Type: application/json" \ | |
| --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' \ | |
| http://localhost:8545 > /dev/null 2>&1; then | |
| echo "Anvil is ready!" | |
| break | |
| fi | |
| echo "Attempt $i/30: Anvil not ready yet, waiting 1 second..." | |
| sleep 1 | |
| done | |
| # Final check to ensure Anvil is responding | |
| if ! curl -s -X POST -H "Content-Type: application/json" \ | |
| --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' \ | |
| http://localhost:8545 > /dev/null 2>&1; then | |
| echo "ERROR: Anvil failed to start properly!" | |
| exit 1 | |
| fi | |
| env: | |
| ANVIL_IP_ADDR: 0.0.0.0 | |
| - name: Run tests | |
| run: pnpm run test | |
| env: | |
| NODE_ENV: test |