-
Notifications
You must be signed in to change notification settings - Fork 17
144 lines (131 loc) · 6.19 KB
/
benchmarks-integration-tests.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
name: Integration tests and benchmarks
on:
pull_request:
workflow_dispatch:
inputs:
llvm_build_type:
description: "LLVM build type: debug | release"
required: true
default: "release"
compiler_tester_reference_rev:
description: "compiler-tester revision to use as a benchmark reference"
required: true
default: "main"
compiler_tester_candidate_rev:
description: "compiler-tester revision to use as a benchmark candidate. Defaults to `main` branch if the `era-compiler-llvm-test` tag doesn't exist"
required: true
default: "era-compiler-llvm-test"
compiler_llvm_reference_branch:
description: "compiler-llvm branch to use as a benchmark reference"
required: true
default: "main"
compiler_llvm_candidate_branch:
description: "compiler-llvm branch to use as a benchmark candidate"
required: true
default: "main"
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
compiler-tester-ref:
runs-on: ubuntu-latest
outputs:
reference-ref: ${{ steps.compiler_tester_ref.outputs.reference-ref }}
candidate-ref: ${{ steps.compiler_tester_ref.outputs.candidate-ref }}
env:
ERA_COMPILER_LLVM_TEST_TAG: era-compiler-llvm-test
ERA_COMPILER_LLVM_REF_DEFAULT: main
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: matter-labs/era-compiler-tester
- name: Define compiler tester ref
id: compiler_tester_ref
shell: bash
run: |
REFERENCE_REF=${{ inputs.compiler_tester_reference_rev || env.ERA_COMPILER_LLVM_REF_DEFAULT }}
if [ -n "$(git ls-remote --tags --heads --refs origin ${REFERENCE_REF})" ]; then
echo "reference-ref=${REFERENCE_REF}" | tee -a "${GITHUB_OUTPUT}"
else
echo "reference-ref=${{ env.ERA_COMPILER_LLVM_REF_DEFAULT }}" | tee -a "${GITHUB_OUTPUT}"
fi
CANDIDATE_REF=${{ inputs.compiler_tester_candidate_rev || env.ERA_COMPILER_LLVM_TEST_TAG }}
if [ -n "$(git ls-remote --tags --heads --refs origin ${CANDIDATE_REF})" ]; then
echo "candidate-ref=${CANDIDATE_REF}" | tee -a "${GITHUB_OUTPUT}"
else
echo "candidate-ref=${{ env.ERA_COMPILER_LLVM_REF_DEFAULT }}" | tee -a "${GITHUB_OUTPUT}"
fi
target-machine:
runs-on: ubuntu-latest
outputs:
evm: ${{ steps.evm.outputs.machine }}
eravm: ${{ steps.eravm.outputs.machine }}
default: ${{ steps.default.outputs.machine }}
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 "machine=eravm" | tee -a "${GITHUB_OUTPUT}"
fi
# 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: [compiler-tester-ref, 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:
llvm_build_type: ${{ github.event.inputs.llvm_build_type }}
compiler_tester_reference_branch: ${{ needs.compiler-tester-ref.outputs.reference-ref }}
compiler_tester_candidate_branch: ${{ needs.compiler-tester-ref.outputs.candidate-ref }}
compiler_llvm_reference_branch: ${{ github.event.inputs.compiler_llvm_reference_branch || github.event.repository.default_branch }}
compiler_llvm_candidate_branch: ${{ github.event.inputs.compiler_llvm_candidate_branch || github.head_ref }}
compiler_llvm_benchmark_mode: ${{ github.event.inputs.compiler_llvm_benchmark_mode || '^M^B3' }}
compiler_llvm_benchmark_path: ${{ github.event.inputs.compiler_llvm_benchmark_path || '' }}
ccache-key-type: 'static' # rotate ccache key every month
compiler-llvm-repo: ${{ github.event.pull_request.head.repo.full_name }} # required to properly test forks
target-machine: ${{ matrix.target }}
# 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: [compiler-tester-ref, 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-ref: ${{ needs.compiler-tester-ref.outputs.candidate-ref }}
llvm-ref: ${{ github.event.inputs.compiler_llvm_candidate_branch || github.head_ref || github.event.repository.default_branch }}
ccache-key-type: 'static' # rotate ccache key every month
compiler-llvm-repo: ${{ github.event.pull_request.head.repo.full_name }} # required to properly test forks
target-machine: ${{ matrix.target }}