-
Notifications
You must be signed in to change notification settings - Fork 52
134 lines (117 loc) · 4.42 KB
/
vite_hardhat_nightly.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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 * * *'
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!
continue-on-error: true
outputs:
is_stable: ${{ steps.get-stability.outputs.is_stable }}
steps:
- uses: actions/checkout@v4
- name: Set up yarn
uses: ./.github/actions/setup-yarn
with:
project: vite-hardhat
- name: Set up nargo
uses: ./.github/actions/setup-nargo
with:
version: ${{ matrix.version }}
- 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 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
notify:
needs: [vite-hardhat-test-drift, vite-hardhat-setup]
runs-on: ubuntu-latest
strategy:
matrix:
version: ${{ fromJson(needs.vite-hardhat-setup.outputs.versions) }}
if: ${{ needs.vite-hardhat-test-drift.result == 'failure' }}
steps:
- name: Send GitHub Action trigger data to Slack workflow - Stable
uses: slackapi/[email protected]
if: ${{ needs.vite-hardhat-test-drift.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: ${{ needs.vite-hardhat-test-drift.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 }}