-
Notifications
You must be signed in to change notification settings - Fork 16
184 lines (168 loc) · 7 KB
/
scheduled.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
180
181
182
183
184
name: Scheduled build
# This workflow is triggered by a schedule or manually
# It allows to build LLVM, run regression tests and integration tests
# for all supported platforms by user's choice
# It also allows to enable assertions and/or valgrind for regression tests
# and regenerates ccache
on:
schedule:
- cron: '0 0 * * 0' # every week
workflow_dispatch:
inputs:
ref:
description: "Git REF to use for the build"
required: false
type: string
build_macos_amd64:
description: "Build for MacOS amd64?"
required: false
type: boolean
default: true
build_macos_arm64:
description: "Build for MacOS arm64?"
required: false
type: boolean
default: true
build_linux_amd64:
description: "Build for Linux amd64?"
required: false
type: boolean
default: true
build_linux_arm64:
description: "Build for Linux arm64?"
required: false
type: boolean
default: true
build_windows_amd64:
description: "Build for Windows amd64?"
required: false
type: boolean
default: true
run_regression_tests:
description: "Run regression tests?"
required: false
type: boolean
default: false
run_integration_tests:
description: "Run integration tests?"
required: false
type: boolean
default: false
enable-valgrind:
required: false
default: false
type: boolean
description: 'Enable valgrind for regression tests?'
enable_assertions:
description: "Enable assertions?"
required: false
type: boolean
default: true
jobs:
prepare-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.prepare-matrix.outputs.matrix }}
steps:
- name: Prepare matrix
id: prepare-matrix
run: |
# Define general matrix parameters
# Windows is not supported yet on era-compiler-tester side
# WINDOWS='{"name":"Windows-x86","runner":"windows-2019-github-hosted-64core"}'
MACOS_AMD64='{"name":"MacOS-x86","runner":"macos-12-large"}'
MACOS_ARM64='{"name":"MacOS-arm64","runner":["self-hosted","macOS","ARM64"]}'
LINUX_AMD64='{"name":"Linux-AMD64","runner":"matterlabs-ci-runner-high-performance","image":"ghcr.io/matter-labs/zksync-llvm-runner:latest"}'
LINUX_ARM64='{"name":"Linux-ARM64","runner":"matterlabs-ci-runner-arm","image":"ghcr.io/matter-labs/zksync-llvm-runner:latest"}'
# Disable platforms for non-tag builds if user requested
if [ ${GITHUB_EVENT_NAME} = workflow_dispatch ]; then
[ ${{ github.event.inputs.build_windows_amd64 }} != true ] && WINDOWS=
[ ${{ github.event.inputs.build_macos_amd64 }} != true ] && MACOS_AMD64=
[ ${{ github.event.inputs.build_macos_arm64 }} != true ] && MACOS_ARM64=
[ ${{ github.event.inputs.build_linux_amd64 }} != true ] && LINUX_AMD64=
[ ${{ github.event.inputs.build_linux_arm64 }} != true ] && LINUX_ARM64=
fi
PLATFORMS=(${WINDOWS} ${MACOS_AMD64} ${MACOS_ARM64} ${LINUX_AMD64} ${LINUX_ARM64})
echo "matrix={ \"include\": [ $(IFS=, ; echo "${PLATFORMS[*]}") ] }" | tee -a "${GITHUB_OUTPUT}"
integration-tests:
needs: prepare-matrix
uses: matter-labs/era-compiler-ci/.github/workflows/integration-tests.yaml@main
secrets: inherit
if: ${{ inputs.run_integration_tests || github.event_name == 'schedule' }}
with:
ccache-key-type: 'static' # rotate ccache key every month
llvm-ref: ${{ inputs.ref }}
target-machine: 'eravm' # TODO: add `evm` target when LLVM EVM BE is ready
platforms-matrix: ${{ needs.prepare-matrix.outputs.matrix }}
build:
needs: prepare-matrix
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.prepare-matrix.outputs.matrix) }}
runs-on: ${{ matrix.runner }}
container:
image: ${{ matrix.image || '' }} # Special workaround to allow matrix builds with optional container
name: ${{ matrix.name }}
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
path: "llvm"
- name: Prepare Windows env
if: runner.os == 'Windows'
uses: matter-labs/era-compiler-ci/.github/actions/prepare-msys@v1
- name: Build LLVM
uses: matter-labs/era-compiler-ci/.github/actions/build-llvm@v1
with:
enable-tests: true
enable-assertions: ${{ inputs.enable_assertions }}
clone-llvm: false
ccache-key-type: 'static'
save-ccache: ${{ matrix.name == 'Linux x86' }}
enable-valgrind: ${{ inputs.enable-valgrind }}
# Required to keep executable permissions for binaries
- name: Prepare tarball
run: tar -czf ${{ runner.os }}-${{ runner.arch }}-target-final.tar.gz ./target-llvm/target-final
- name: Upload LLVM binaries
uses: actions/upload-artifact@v4
with:
name: llvm-bins-${{ runner.os }}-${{ runner.arch }}
path: ./${{ runner.os }}-${{ runner.arch }}-target-final.tar.gz
# On Windows, run `llvm-lit` directly with xfail parameter
# due to different incompatibilities in tests and MSYS2 environment
- name: Lit tests (Windows)
if: ${{ (inputs.run_regression_tests || github.event_name == 'schedule') && runner.os == 'Windows' }}
shell: 'msys2 {0}'
env:
LLVM_XFAILS:
"Object/archive-big-read.test;\
Object/archive-extract.test;\
Object/archive-toc.test;\
TableGen/x86-fold-tables.td;\
tools/llvm-ar/empty-uid-gid.test;\
tools/llvm-cov/native_separators.c;\
tools/llvm-libtool-darwin/deterministic-library.test;\
tools/llvm-nm/invalid-tapi-files.test;\
tools/llvm-nm/tapi-files.test;\
tools/llvm-objcopy/ELF/deterministic-archive.test;\
tools/llvm-ranlib/D-flag.test;\
tools/llvm-tapi-diff/v5.test"
LLD_XFAILS:
"MachO/double-unwind-info.s;\
MachO/error-limit.test;\
MachO/local-private-extern.yaml"
run: |
./target-llvm/build-final/bin/llvm-lit.py -sv ./target-llvm/build-final/test --xfail ${LLVM_XFAILS}
./target-llvm/build-final/bin/llvm-lit.py -sv ./target-llvm/build-final/tools/lld/test --xfail ${LLD_XFAILS}
- name: Lit tests (MacOS/Linux)
if: ${{ (inputs.run_regression_tests || github.event_name == 'schedule') && runner.os != 'Windows' }}
run: ninja -C './target-llvm/build-final' verify-llvm -v
- name: Send Slack notification
uses: 8398a7/action-slack@v3
if: failure() && github.event_name == 'schedule'
with:
status: ${{ job.status }}
fields: repo,commit,author,action,eventName,ref,workflow,job,took
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}