-
Notifications
You must be signed in to change notification settings - Fork 18
133 lines (119 loc) · 5.1 KB
/
test.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
name: Tests and benchmarks
on:
pull_request:
workflow_dispatch:
inputs:
compiler_tester_reference_branch:
description: "compiler-tester branch to use as a benchmark reference"
required: false
default: "main"
compiler_tester_candidate_branch:
description: "compiler-tester branch to use as a benchmark candidate"
required: false
default: "era-solidity-test"
concurrency:
group: ${{ github.repository_id }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
compiler-tester-ref:
runs-on: ubuntu-latest
name: Compiler tester ref
outputs:
reference-ref: ${{ steps.compiler_tester_ref.outputs.reference-ref }}
candidate-ref: ${{ steps.compiler_tester_ref.outputs.candidate-ref }}
env:
ERA_SOLIDITY_TEST_TAG: era-solidity-test
ERA_SOLIDITY_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_branch || env.ERA_SOLIDITY_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_SOLIDITY_REF_DEFAULT }}" | tee -a "${GITHUB_OUTPUT}"
fi
CANDIDATE_REF=${{ inputs.compiler_tester_candidate_branch || env.ERA_SOLIDITY_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_SOLIDITY_REF_DEFAULT }}" | tee -a "${GITHUB_OUTPUT}"
fi
build:
strategy:
fail-fast: false
matrix:
include:
- type: "reference"
ref: ${{ github.base_ref }}
- type: "candidate"
ref: ''
runs-on: [ci-runner-compiler, Linux]
name: build-${{ matrix.type }}
container:
image: matterlabs/llvm_runner:ubuntu20-llvm17-latest
outputs:
solc-version: ${{ steps.project_version.outputs.solc-version }}
steps:
- name: Checking out the Solidity repository
uses: actions/checkout@v4
with:
ref: ${{ matrix.ref }}
submodules: recursive
- name: Define project version
id: project_version
shell: bash
run: |
SOLC_VERSION=$(grep 'PROJECT_VERSION' CMakeLists.txt | grep -oP '(\d+\.\d+\.\d+)')
echo "solc-version=${SOLC_VERSION}" | tee -a "${GITHUB_OUTPUT}"
- name: Building the Solidity compiler
if: matrix.type == 'candidate'
uses: matter-labs/era-compiler-ci/.github/actions/build-solc@v1
with:
solc-version: ${{ steps.project_version.outputs.solc-version }}
zksync-version: 1.0.${{ github.run_id }}
build-type: ${{ matrix.type }}
boost-version: 1.83.0
- name: Building the Solidity compiler
if: matrix.type == 'reference'
uses: matter-labs/era-compiler-ci/.github/actions/build-solc@v1
with:
solc-version: ${{ steps.project_version.outputs.solc-version }}
zksync-version: 1.0.${{ github.run_id }}
build-type: ${{ matrix.type }}
boost-version: 1.83.0
# 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, build ]
uses: matter-labs/era-compiler-ci/.github/workflows/integration-tests.yaml@main
secrets: inherit
with:
compiler-tester-ref: ${{ needs.compiler-tester-ref.outputs.candidate-ref }}
path: 'tests/solidity/'
custom-solc-run-id: ${{ github.run_id }}
custom-solc-version: ${{ needs.build.outputs.solc-version }}
extra-args: --mode "${{ github.base_ref }}"
save-ccache: 'true'
ccache-key-type: 'static'
# 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, build ]
uses: matter-labs/era-compiler-ci/.github/workflows/benchmarks.yml@main
secrets: inherit
with:
compiler_tester_reference_branch: ${{ needs.compiler-tester-ref.outputs.reference-ref }}
compiler_tester_candidate_branch: ${{ needs.compiler-tester-ref.outputs.candidate-ref }}
compiler_llvm_benchmark_mode: '+M^B3 ${{ needs.build.outputs.solc-version }}'
compiler_llvm_benchmark_path: 'tests/solidity/'
custom-solc-run-id: ${{ github.run_id }}
custom-solc-version: ${{ needs.build.outputs.solc-version }}