Nightly drift test #19
This file contains 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: 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: | |
versions: ${{ steps.set-matrix.outputs.versions }} | |
versions_map: ${{ steps.set-matrix.outputs.versions_map }} | |
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=versionsMap::$output" | |
- name: Set Up Matrix | |
id: set-matrix | |
run: | | |
VERSIONS_MAP='${{ steps.versions_step.outputs.versionsMap }}' | |
echo "Versions out of script: $VERSIONS_MAP" | |
VERSIONS=$(echo "$VERSIONS_MAP" | jq -c '[.[]]') | |
echo "::set-output name=versions::$VERSIONS" | |
echo "::set-output name=versions_map::$VERSIONS_MAP" | |
test-drift: | |
needs: setup | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ${{ matrix.project }} | |
strategy: | |
fail-fast: false | |
matrix: | |
version: ${{ fromJson(needs.setup.outputs.versions) }} | |
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 }} | |
- name: Get stability | |
id: get-stability | |
env: | |
VERSIONS_MAP: ${{ needs.setup.outputs.versions_map }} | |
run: | | |
VERSION="${{ matrix.version }}" | |
echo "Version Number: $VERSION" | |
STABLE_VERSION=$(echo "$VERSIONS_MAP" | jq -r --arg VERSION "$VERSION" '.stable') | |
if [ "$STABLE_VERSION" == "$VERSION" ]; then | |
IS_STABLE="true" | |
else | |
IS_STABLE="false" | |
fi | |
echo "Is stable: $IS_STABLE" | |
echo "Project: ${{ matrix.project }}" | |
echo "::set-output name=is_stable::$IS_STABLE" | |
- name: Install test version | |
run: | | |
yarn add \ | |
@noir-lang/noir_js@${{ matrix.version }} \ | |
@noir-lang/backend_barretenberg@${{ matrix.version }} \ | |
@noir-lang/noir_wasm@${{ matrix.version }} \ | |
@noir-lang/types@${{ matrix.version }} | |
- 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: ${{ steps.get-stability.outputs.is_stable == 'false' }} | |
- name: Send GitHub Action trigger data to Slack workflow | |
id: slack | |
uses: slackapi/[email protected] | |
if: ${{ failure() && steps.get-stability.outputs.is_stable == 'false' }} | |
with: | |
payload: | | |
{ | |
"text": "Once the prerelease becomes stable, projects need updating: ${{ matrix.project }}" | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |