-
Notifications
You must be signed in to change notification settings - Fork 15
145 lines (129 loc) · 5.32 KB
/
tests.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
135
136
137
138
139
140
141
142
143
144
145
name: Tests
on:
pull_request:
workflow_dispatch:
inputs:
compiler_tester_reference_branch:
description: "compiler-tester branch to use as a benchmark reference"
required: true
default: "main"
compiler_tester_candidate_branch:
description: "compiler-tester branch to use as a benchmark candidate"
required: true
default: "main"
compiler_llvm_reference_branch:
description: "compiler-llvm branch to use as a benchmark reference"
required: false
default: "main"
compiler_llvm_candidate_branch:
description: "compiler-llvm branch to use as a benchmark candidate"
required: false
default: ""
compiler_llvm_benchmark_mode:
description: "Mode filter for compiler-llvm benchmarks"
required: false
default: "^M^B3"
compiler_llvm_benchmark_path:
description: "Path filter for compiler-llvm benchmarks"
required: false
default: ""
concurrency:
group: ${{ github.repository_id }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# Check for secrets leak in the repository
secrets-scanner:
uses: matter-labs/era-compiler-ci/.github/workflows/secrets-scanner.yaml@v1
secrets: inherit
# Check for cargo issues
cargo-check:
runs-on: matterlabs-ci-runner-high-performance
container:
image: ghcr.io/matter-labs/zksync-llvm-runner:latest
steps:
- uses: actions/checkout@v4
- name: Build LLVM
uses: matter-labs/era-compiler-ci/.github/actions/build-llvm@v1
with:
enable-assertions: true
ccache-key-type: static
- name: Cargo checks
uses: matter-labs/era-compiler-ci/.github/actions/cargo-check@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Define target for integration tests and benchmarks
# based on PR title labels
target-machine:
runs-on: ubuntu-latest
outputs:
evm: ${{ steps.evm.outputs.machine || steps.default.outputs.evm }}
eravm: ${{ steps.eravm.outputs.machine || steps.default.outputs.eravm }}
steps:
- name: Check for EraVM target
id: eravm
if: contains(github.event.pull_request.title, '(eravm)') || contains(github.event.pull_request.title, '(EraVM)')
run: echo "machine=eravm" | tee -a "${GITHUB_OUTPUT}"
- name: Check for EVM target
id: evm
if: contains(github.event.pull_request.title, '(evm)') || contains(github.event.pull_request.title, '(EVM)')
run: echo "machine=evm" | tee -a "${GITHUB_OUTPUT}"
- name: Check for default target
id: default
shell: bash -ex {0}
run: |
if [[ "${{ join(steps.*.outputs.*) }}" == "" ]]; then
echo "eravm=eravm" | tee -a "${GITHUB_OUTPUT}"
echo "evm=evm" | tee -a "${GITHUB_OUTPUT}"
fi
# Integration tests workflow call from the era-compiler-ci repository
# This is a common part of the integration tests workflow for all repositories
# If you would like to make a change to the integration tests workflow, please do it in the era-compiler-ci repository
integration-tests:
needs: target-machine
uses: matter-labs/era-compiler-ci/.github/workflows/integration-tests.yaml@v1
secrets: inherit
strategy:
fail-fast: false
matrix:
target: ${{ needs.target-machine.outputs.* }}
with:
compiler-tester-repo: ${{ github.event.pull_request.head.repo.full_name }} # required to properly test forks
ccache-key-type: static
target-machine: ${{ matrix.target }}
# Benchmarks workflow call from the era-compiler-ci repository
# This is a common part of the benchmarks workflow for all repositories
# If you would like to make a change to the benchmarks workflow, please do it in the era-compiler-ci repository
benchmarks:
needs: target-machine
uses: matter-labs/era-compiler-ci/.github/workflows/benchmarks.yml@v1
secrets: inherit
strategy:
fail-fast: false
matrix:
target: ${{ needs.target-machine.outputs.* }}
with:
compiler_tester_reference_branch: ${{ github.event.inputs.compiler_tester_reference_branch || 'main' }}
compiler_tester_candidate_branch: ${{ github.event.inputs.compiler_tester_candidate_branch || '' }}
compiler_llvm_candidate_branch: ${{ github.event.inputs.compiler_llvm_candidate_branch || '' }}
compiler_llvm_reference_branch: ${{ github.event.inputs.compiler_llvm_reference_branch || 'main' }}
compiler_llvm_benchmark_mode: ${{ github.event.inputs.compiler_llvm_benchmark_mode || '^M^B3' }}
compiler_llvm_benchmark_path: ${{ github.event.inputs.compiler_llvm_benchmark_path || '' }}
compiler-tester-repo: ${{ github.event.pull_request.head.repo.full_name }}
ccache-key-type: static
target-machine: ${{ matrix.target }}
# 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:
- secrets-scanner
- cargo-check
- integration-tests
- benchmarks
steps:
- name: Decide on PR checks
uses: re-actors/alls-green@release/v1
with:
allowed-failures: integration-tests, benchmarks
jobs: ${{ toJSON(needs) }}