ci: keep bbup installation to minimal #32
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: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| # Job 1: Check commit messages | |
| Lint: | |
| name: Check Commit Messages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Validate commit messages | |
| if: github.event_name == 'pull_request' | |
| run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose | |
| - name: Validate commit messages | |
| if: github.event_name == 'push' | |
| run: npx --no -- commitlint --from=HEAD~1 | |
| # Job 2: Circuit build | |
| circuit-build: | |
| name: Circuit Build | |
| 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' | |
| cache: 'yarn' | |
| - name: Install Noir | |
| uses: noir-lang/[email protected] | |
| with: | |
| toolchain: '1.0.0-beta.6' | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Build circuit | |
| run: yarn circuit:build | |
| - name: Upload circuit artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: circuit-build-artifacts | |
| path: circuit/target/ | |
| retention-days: 1 | |
| # Job 3: Circuit test | |
| circuit-test: | |
| name: Circuit Test | |
| 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' | |
| cache: 'yarn' | |
| - name: Install Noir | |
| uses: noir-lang/[email protected] | |
| with: | |
| toolchain: '1.0.0-beta.6' | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Run circuit tests | |
| run: yarn circuit:test | |
| # Job 4: Circuit prove and verify | |
| circuit-prove-verify: | |
| name: Circuit Prove & Verify | |
| runs-on: ubuntu-latest | |
| needs: circuit-build | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'yarn' | |
| - name: Install Noir | |
| uses: noir-lang/[email protected] | |
| with: | |
| toolchain: '1.0.0-beta.6' | |
| - name: Install Barretenberg | |
| shell: bash | |
| run: | | |
| # mkdir -p $HOME/.bb | |
| curl -L -o $HOME/.bb/bbup_installer https://raw.githubusercontent.com/AztecProtocol/aztec-packages/master/barretenberg/bbup/install | |
| echo "Installer downloaded..." | |
| bash $HOME/.bb/bbup_installer | |
| echo "bbup installed..." | |
| echo "${HOME}/.bb" >> $GITHUB_PATH | |
| echo "Added ${HOME}/.bb to PATH" | |
| bash $HOME/.bb/bbup -nv $(nargo -V | head -n1 | awk '{print $4}') | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Download circuit artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: circuit-build-artifacts | |
| path: circuit/target/ | |
| - name: Generate witness | |
| run: yarn circuit:witness | |
| - name: Generate verification key | |
| run: yarn circuit:vk | |
| - name: Generate proof | |
| run: yarn circuit:prove | |
| - name: Verify proof | |
| run: yarn circuit:verify | |
| # Job 5: Contracts compile | |
| contracts-compile: | |
| name: Contracts Compile | |
| 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' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Compile contracts | |
| run: yarn contracts:compile | |
| - name: Upload contract artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: contract-artifacts | |
| path: | | |
| artifacts/ | |
| cache/ | |
| retention-days: 1 | |
| # Job 6: Contracts test | |
| contracts-test: | |
| name: Contracts Test | |
| runs-on: ubuntu-latest | |
| needs: [circuit-build, contracts-compile] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Download circuit artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: circuit-build-artifacts | |
| path: circuit/target/ | |
| - name: Download contract artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: contract-artifacts | |
| path: ./ | |
| - name: Run contract tests | |
| run: yarn contracts:test |