-
Notifications
You must be signed in to change notification settings - Fork 37
139 lines (125 loc) · 4.87 KB
/
test.yaml
File metadata and controls
139 lines (125 loc) · 4.87 KB
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
name: Tests
# Execute workflow for each PR and with each merge to the trunk
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
# Cancel the workflow if any new changes pushed to a feature branch or the trunk
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# Check for cargo issues
cargo-checks:
runs-on: matterlabs-ci-runner-high-performance
container:
image: ghcr.io/matter-labs/zksync-llvm-runner:latest
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: 'recursive'
# This step is required to checkout submodules
# that are disabled in .gitmodules config
- name: Checkout submodules
run: |
git config --global --add safe.directory '*'
git submodule update --force --depth=1 --recursive --checkout
- name: Build LLVM
uses: matter-labs/era-compiler-ci/.github/actions/build-llvm@v1
with:
clone-llvm: 'false'
build-type: 'Release'
enable-assertions: 'false'
ccache-key: ${{ format('llvm-{0}-{1}-gnu', runner.os, runner.arch) }}
save-ccache: 'false'
- name: Cargo checks
uses: matter-labs/era-compiler-ci/.github/actions/cargo-check@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build and run regression tests
build-and-test:
strategy:
fail-fast: false # finalize testing of all targets even if one failed
matrix:
include:
- name: "MacOS x86"
runner: macos-latest-large
- name: "MacOS arm64"
runner: macos-latest-xlarge
- name: "Linux x86 gnu"
runner: matterlabs-ci-runner-high-performance
image: ghcr.io/matter-labs/zksync-llvm-runner:latest
target: "x86_64-unknown-linux-gnu"
enable-coverage: 'true' # enable coverage on Linux GNU
- name: "Linux ARM64 gnu"
runner: matterlabs-ci-runner-arm
image: ghcr.io/matter-labs/zksync-llvm-runner:latest
target: "aarch64-unknown-linux-gnu"
- name: "Linux x86 musl"
runner: matterlabs-ci-runner-high-performance
image: ghcr.io/matter-labs/zksync-llvm-runner:latest
target: "x86_64-unknown-linux-musl"
- name: "Linux ARM64 musl"
runner: matterlabs-ci-runner-arm
image: ghcr.io/matter-labs/zksync-llvm-runner:latest
target: "aarch64-unknown-linux-musl"
# - name: "Windows"
# runner: windows-2022-github-hosted-16core
# target: "x86_64-pc-windows-gnu"
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:
submodules: 'recursive'
# This step is required to checkout submodules
# that are disabled in .gitmodules config
- name: Checkout submodules
run: |
git config --global --add safe.directory '*'
git submodule update --force --depth=1 --recursive --checkout
- name: Checkout host LLVM for musl build
uses: actions/checkout@v4
if: contains(matrix.target, 'musl')
with:
repository: 'llvm/llvm-project'
path: 'llvm-host'
ref: 'llvmorg-19.1.7'
fetch-depth: '1'
- 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:
clone-llvm: 'false'
target-env: ${{ contains(matrix.target, 'musl') && 'musl' || 'gnu' }}
enable-assertions: 'true'
build-type: RelWithDebInfo
ccache-key: ${{ format('llvm-{0}-{1}-{2}', runner.os, runner.arch, contains(matrix.target, 'musl') && 'musl' || 'gnu') }}
save-ccache: 'false'
- name: Run tests
uses: matter-labs/era-compiler-ci/.github/actions/rust-unit-tests@v1
with:
target: ${{ matrix.target || '' }}
enable-coverage: ${{ matrix.enable-coverage || 'false' }}
coverage-token: ${{ secrets.CODECOV_TOKEN }}
# Special job that allows some of the jobs to be skipped or failed
# requiring others to be successful
pr-checks:
runs-on: ubuntu-latest
if: always()
needs:
- cargo-checks
- build-and-test
steps:
- name: Decide on PR checks
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}