-
Notifications
You must be signed in to change notification settings - Fork 327
179 lines (167 loc) · 6.57 KB
/
nightly-kind-test.yml
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: KIND network tests
on:
workflow_dispatch:
schedule:
- cron: "00 08 * * 1-5"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DOCKERHUB_PASSWORD: "${{ secrets.DOCKERHUB_PASSWORD }}"
RUN_ID: ${{ github.run_id }}
RUN_ATTEMPT: ${{ github.run_attempt }}
USERNAME: ${{ github.event.pull_request.user.login || github.actor }}
GITHUB_TOKEN: ${{ github.token }}
GH_SELF_HOSTED_RUNNER_TOKEN: ${{ secrets.GH_SELF_HOSTED_RUNNER_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
GIT_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
EXTERNAL_ETHEREUM_HOST: "https://json-rpc.${{ secrets.SEPOLIA_EXTERNAL_HOST }}?key=${{ secrets.SEPOLIA_API_KEY }}"
EXTERNAL_ETHEREUM_CONSENSUS_HOST: "https://beacon.${{ secrets.SEPOLIA_EXTERNAL_HOST }}"
GCP_API_KEY_HEADER: "X-goog-api-key"
jobs:
setup:
uses: ./.github/workflows/setup-runner.yml
with:
username: ${{ github.actor }}
runner_type: builder-x86
secrets: inherit
find-image:
runs-on: ubuntu-latest
outputs:
image_tag: ${{ steps.find-tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: Find latest available image tag
id: find-tag
run: |
COMMIT=${{ env.GIT_COMMIT }}
MAX_ATTEMPTS=10
for ((i=0; i<MAX_ATTEMPTS; i++)); do
if docker pull aztecprotocol/aztec:$COMMIT-amd64 >/dev/null 2>&1; then
echo "tag=$COMMIT-amd64" >> $GITHUB_OUTPUT
exit 0
fi
# Get previous commit
COMMIT=$(git rev-parse "$COMMIT^")
done
echo "Error: Could not find a valid image tag after $MAX_ATTEMPTS attempts"
exit 1
test:
needs: [setup, find-image]
runs-on: ubuntu-20.04
strategy:
matrix:
test:
- transfer.test.ts
- reorg.test.ts
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
- name: Setup and Test
uses: ./.github/ensure-tester
timeout-minutes: 90
with:
runner_type: 16core-tester-x86
ttl: 90
run: |
docker pull aztecprotocol/aztec:${{ needs.find-image.outputs.image_tag }}
AZTEC_DOCKER_TAG=${{ needs.find-image.outputs.image_tag }} FORCE_COLOR=1 INSTALL_METRICS=false ./spartan/scripts/test_kind.sh "./src/spartan/${{ matrix.test }}" 16-validators.yaml
proving-test:
needs: [setup, find-image]
runs-on: ubuntu-20.04
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
- name: Setup and Test
uses: ./.github/ensure-tester
timeout-minutes: 90
with:
runner_type: 128core-tester-x86
ttl: 90
run: |
docker pull aztecprotocol/aztec:${{ needs.find-image.outputs.image_tag }}
AZTEC_DOCKER_TAG=${{ needs.find-image.outputs.image_tag }} INSTALL_TIMEOUT=45m FORCE_COLOR=1 INSTALL_METRICS=false \
./spartan/scripts/test_kind.sh ./src/spartan/proving.test.ts 1-validator-with-proving || true
kind-sepolia-test:
needs: [setup, find-image]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- test: 4epochs.test.ts
values: ci-sepolia.yaml
runner_type: 16core-tester-x86
timeout: 40
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- name: Setup and KIND Network Test against Sepolia
timeout-minutes: ${{ matrix.config.timeout }}
uses: ./.github/ensure-tester
with:
runner_type: ${{ matrix.config.runner_type }}
spot_strategy: None # use on-demand machines
ttl: ${{ matrix.config.timeout }}
run: |
until docker info &>/dev/null; do sleep 1; done
export CI=1 NO_CACHE=0
artifact="kind-network-${{matrix.config.test}}-$(./spartan/bootstrap.sh hash)"
if ci3/test_should_run "$artifact"; then
docker pull aztecprotocol/aztec:${{ needs.find-image.outputs.image_tag }}
# Set the sepolia run variables
export EXTERNAL_ETHEREUM_HOST=${{ env.EXTERNAL_ETHEREUM_HOST }}
export EXTERNAL_ETHEREUM_CONSENSUS_HOST=${{ env.EXTERNAL_ETHEREUM_CONSENSUS_HOST }}
export EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY=${{ secrets.SEPOLIA_API_KEY }}
export EXTERNAL_ETHEREUM_CONSENSUS_HOST_API_KEY_HEADER=${{ env.GCP_API_KEY_HEADER }}
export L1_DEPLOYMENT_PRIVATE_KEY=${{ secrets.SEPOLIA_L1_DEPLOYMENT_PRIVATE_KEY }}
export L1_ACCOUNTS_MNEMONIC="${{ secrets.SEPOLIA_ACCOUNTS_MNEMONIC }}"
AZTEC_DOCKER_TAG=${{ needs.find-image.outputs.image_tag }} SEPOLIA_RUN=true INSTALL_METRICS=false ./spartan/scripts/test_kind.sh "./src/spartan/${{ matrix.config.test }}" "${{ matrix.config.values }}"
ci3/cache_upload_flag "$artifact"
fi
- name: Copy Network Logs
if: always()
run: scripts/copy_from_tester spartan/scripts/logs/test_kind.log test_kind.log || true
- name: Upload Network Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: kind-network-test-${{ matrix.config.values }}-${{ matrix.config.test }}.log
path: test_kind.log
success-check:
runs-on: ubuntu-20.04
needs:
- test
- proving-test
if: always()
steps:
- name: Report overall success
env:
# We treat any skipped or failing jobs as a failure for the workflow as a whole.
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: |
if [[ $FAIL == true ]]; then
echo "Test failed."
exit 1
fi
notify:
needs:
- success-check
runs-on: ubuntu-20.04
if: ${{ github.ref == 'refs/heads/master' && failure() }}
steps:
- name: Send notification to aztec3-ci channel if workflow failed on master
uses: slackapi/slack-github-action@v1.25.0
with:
payload: |
{
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_WORKFLOW_TRIGGER_URL }}