Skip to content

Nightly drift test

Nightly drift test #14

Workflow file for this run

name: Nightly drift test
on:
# Giving ourselves a way to trigger this manually
workflow_dispatch:
schedule:
# Run a nightly release at 2 AM UTC
- cron: '0 2 * * *'
jobs:
setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- name: Get versions to test for drift
id: versions_step
run: |
output=$(node ./.github/scripts/latest.js)
echo "Output from Node.js script: $output"
echo "::set-output name=versionArray::$output"
- name: Set Up Matrix
id: set-matrix
run: |
VERSIONS='${{ steps.versions_step.outputs.versionArray }}'
echo "Versions for Matrix: $VERSIONS"
MATRIX=$(echo "$VERSIONS" | jq -c '{versions: .} | .versions | to_entries | map({key: .key, value: (.value | sub("^v"; ""))})')
echo "::set-output name=matrix::{\"include\":$MATRIX}"
test-drift:
needs: setup
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ matrix.project }}
strategy:
matrix:
version:
- version: ${{fromJson(needs.setup.outputs.matrix).key}}
- version_number: ${{fromJson(needs.setup.outputs.matrix).value}}
project: [vite-hardhat, with-foundry]
steps:
- uses: actions/checkout@v4
- name: Set up test environment
uses: ./.github/actions/setup
with:
project: vite-hardhat
version: ${{ matrix.version.version_number }}
- name: Install test version
run: |
yarn add \
@noir-lang/noir_js@${{ matrix.version.version_number }} \
@noir-lang/backend_barretenberg@${{ matrix.version.version_number }} \
@noir-lang/noir_wasm@${{ matrix.version.version_number }} \
@noir-lang/types@${{ matrix.version.version_number }}
- name: 'Create env file'
run: |
touch .env
echo SEPOLIA_ALCHEMY_KEY="${{ secrets.SEPOLIA_ALCHEMY_KEY }}" >> .env
echo SEPOLIA_DEPLOYER_PRIVATE_KEY="${{ secrets.SEPOLIA_DEPLOYER_PRIVATE_KEY }}" >> .env
echo MUMBAI_ALCHEMY_KEY"=${{ secrets.MUMBAI_ALCHEMY_KEY }}" >> .env
echo MUMBAI_DEPLOYER_PRIVATE_KEY="${{ secrets.MUMBAI_DEPLOYER_PRIVATE_KEY }}" >> .env
- name: Generate verifier contract
run: |
nargo codegen-verifier
working-directory: vite-hardhat/circuits
- name: Run test
run: yarn test
id: yarn_test
continue-on-error: ${{ matrix.version.version == 'prerelease' }}
- name: Send GitHub Action trigger data to Slack workflow
id: slack
uses: slackapi/[email protected]
if: ${{ failure() && matrix.version.version == 'prerelease' }}
with:
payload: |
{
"text": "Hey! Just to let you know that once the prerelease becomes stable, you'll need to update the following project: ${{ matrix.project }}. ",
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}