Skip to content

Nightly Vite-Hardhat drift test #372

Nightly Vite-Hardhat drift test

Nightly Vite-Hardhat drift test #372

name: Nightly Vite-Hardhat 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 * * *'
pull_request:
paths:
- 'vite-hardhat/**'
jobs:
vite-hardhat-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"
vite-hardhat-test-drift:
needs: vite-hardhat-setup
runs-on: ubuntu-latest
defaults:
run:
working-directory: vite-hardhat
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.vite-hardhat-setup.outputs.versions) }}
# if it errors, we still need to know about it!
steps:
- uses: actions/checkout@v4
- name: Set up bun
uses: oven-sh/setup-bun@v1
- name: Get stability
id: get-stability
env:
VERSIONS_MAP: ${{ needs.vite-hardhat-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 "::set-output name=is_stable::$IS_STABLE"
- name: Install dependencies
run: bun install
- name: Install test version
run: |
bun i \
@noir-lang/noir_js@${{ matrix.version }} \
@noir-lang/backend_barretenberg@${{ matrix.version }} \
@noir-lang/noir_wasm@${{ matrix.version }} \
@noir-lang/types@${{ matrix.version }}
- name: Compile
run: bunx hardhat compile
- name: Run tests
run: bun test
- name: Send GitHub Action trigger data to Slack workflow - Stable
uses: slackapi/[email protected]
if: ${{ failure() && steps.get-stability.outputs.is_stable == 'true' }}
with:
payload: |
{
"text": "Oooops, seems like latest stable Noir breaks noir-starter! Projects needing updating: vite-hardhat ${{ matrix.version }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Send GitHub Action trigger data to Slack workflow - Prerelease
uses: slackapi/[email protected]
if: ${{ failure() && steps.get-stability.outputs.is_stable == 'false' }}
with:
payload: |
{
"text": "Heads up DevRel! Once the prerelease becomes stable, the following project will break: vite-hardhat ${{ matrix.version }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}