Skip to content

feat: adds lint pipelines (#3) #47

feat: adds lint pipelines (#3)

feat: adds lint pipelines (#3) #47

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
commit-message:
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: '20'
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
typescript-lint:
name: TypeScript Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run ESLint
run: yarn typescript:lint
solidity-lint:
name: Solidity Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run Solhint
run: yarn solidity:lint
format-check:
name: Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Check formatting
run: yarn format:check
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: '20'
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
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: '20'
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
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: '20'
cache: 'yarn'
- name: Install Noir
uses: noir-lang/[email protected]
with:
toolchain: '1.0.0-beta.6'
- name: Install Barretenberg
shell: bash
run: |
curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/master/barretenberg/bbup/install | bash
echo "${HOME}/.bb" >> $GITHUB_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
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: '20'
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
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: '20'
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