-
Notifications
You must be signed in to change notification settings - Fork 241
141 lines (135 loc) · 4.88 KB
/
ci-arm.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
name: CI (ARM)
on:
push:
branches:
- master
- "*/*arm-build"
workflow_dispatch:
inputs: {}
concurrency:
group: ci-master-arm
env:
DOCKERHUB_PASSWORD: "${{ secrets.DOCKERHUB_PASSWORD }}"
RUN_ID: ${{ github.run_id }}
RUN_ATTEMPT: ${{ github.run_attempt }}
USERNAME: master
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.sha }}
# kludge until we move away from runners
WAIT_FOR_RUNNERS: false
jobs:
setup:
uses: ./.github/workflows/setup-runner.yml
with:
username: master
runner_type: builder-arm
secrets: inherit
changes:
runs-on: ubuntu-20.04
# Required permissions.
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
build-images: ${{ steps.filter.outputs.build-images }}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
id: filter
with:
filters: |
build-images:
- 'build-images/**'
build-images:
needs: [setup, changes]
# Note we don't put the 'if' here as that would also apply to dependent jobs, instead we just copy it into each step
runs-on: master-arm
steps:
# permission kludge before checkout, see https://github.com/actions/checkout/issues/211#issuecomment-611986243
- run: sudo chown -R $USER:$USER /home/ubuntu/
if: needs.changes.outputs.build-images == 'true'
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
if: needs.changes.outputs.build-images == 'true'
- uses: ./.github/ci-setup-action
if: needs.changes.outputs.build-images == 'true'
with:
concurrency_key: build-images-arm
- name: "Push Build Images If Changed"
if: needs.changes.outputs.build-images == 'true'
timeout-minutes: 40
run: |
earthly-ci --push ./build-images/+build
build:
needs: [build-images]
runs-on: master-arm
steps:
# permission kludge before checkout, see https://github.com/actions/checkout/issues/211#issuecomment-611986243
- run: sudo chown -R $USER:$USER /home/ubuntu/
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: build-arm
# prepare images locally, tagged by commit hash
- name: "Build E2E Image"
timeout-minutes: 60
run: |
sudo shutdown -P 60 # necessary to get around builtin hard timeout
earthly-ci ./yarn-project+export-e2e-test-images
# all the non-bench end-to-end integration tests for aztec
e2e:
needs: [build]
runs-on: master-arm
steps:
# permission kludge before checkout, see https://github.com/actions/checkout/issues/211#issuecomment-611986243
- run: sudo chown -R $USER:$USER /home/ubuntu/
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: e2e-arm
# prepare images locally, tagged by commit hash
- name: "Build E2E Image"
timeout-minutes: 40
working-directory: ./yarn-project/end-to-end
run: |
./scripts/e2e_compose_test.sh uniswap_trade_on_l1_from_l2.test.ts
rerun-check:
runs-on: ubuntu-20.04
permissions:
actions: write
needs: [setup, build-images, build, e2e]
if: ${{ !cancelled() }}
steps:
- name: Check for Rerun
env:
# We treat any skipped or failing jobs as a failure for the workflow as a whole.
HAD_FAILURE: ${{ contains(needs.*.result, 'failure') }}
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: |
if [[ $HAD_FAILURE == true ]] && [[ $RUN_ATTEMPT -lt 2 ]] ; then
echo "Retrying first workflow failure. This is a stop-gap until things are more stable."
gh workflow run rerun.yml -F run_id=${{ github.run_id }}
fi
# NOTE: we only notify failures after a rerun has occurred
notify:
needs: [e2e]
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' && failure() && github.run_attempt >= 2 }}
steps:
- name: Send notification to aztec3-ci channel if workflow failed on master
uses: slackapi/[email protected]
with:
payload: |
{
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_WORKFLOW_TRIGGER_URL }}