Skip to content

Commit d3be55e

Browse files
ci: update code coverage workflow
1 parent c8375df commit d3be55e

File tree

1 file changed

+44
-53
lines changed

1 file changed

+44
-53
lines changed

.github/workflows/coverage.yml

Lines changed: 44 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,18 @@ on:
44
push:
55
branches:
66
- main
7-
workflow_dispatch:
8-
inputs:
9-
mode:
10-
description: "Mode filter for era-compiler-tester"
11-
required: true
12-
default: "0.8"
13-
path:
14-
description: "Path filter for era-compiler-tester"
15-
required: true
16-
default: "tests/solidity/complex/defi"
7+
pull_request:
178

189
defaults:
1910
run:
2011
shell: bash -ex {0}
2112

2213
concurrency:
2314
group: ${{ github.repository_id }}-${{ github.workflow }}-${{ github.ref }}
24-
cancel-in-progress: false
15+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2516

2617
env:
27-
PROFDATA_FILE: zksolc.profdata
18+
PROFDATA_FILE: llvm.profdata
2819
LCOV_FILE: codecov.lcov
2920
OUTPUT_HTML_DIR: COVERAGE
3021

@@ -33,79 +24,79 @@ jobs:
3324
runs-on: matterlabs-ci-runner-high-performance
3425
container:
3526
image: ghcr.io/matter-labs/zksync-llvm-runner:latest
36-
options: -m 110g
37-
env:
38-
TARGET: x86_64-unknown-linux-gnu
39-
RUSTC_BOOTSTRAP: 1
40-
LATEST_SOLC_VERSION: 0.8
41-
DEFAULT_BENCHMARKS_PATH: tests/solidity/complex/defi
4227
steps:
4328

44-
- name: Checkout compiler-tester
29+
- name: Checkout solx
4530
uses: actions/checkout@v4
4631
with:
4732
ref: 'main'
48-
repository: matter-labs/era-compiler-tester
33+
repository: matter-labs/solx
4934
submodules: recursive
5035

36+
# This step is required to checkout submodules
37+
# that are disabled in .gitmodules config
38+
- name: Checkout submodules
39+
run: |
40+
git config --global --add safe.directory '*'
41+
git submodule update --force --depth=1 --recursive --checkout
42+
43+
- name: Remove llvm submodule
44+
run: rm -rf llvm
45+
5146
- name: Checkout llvm
5247
uses: actions/checkout@v4
5348
with:
54-
repository: matter-labs/era-compiler-llvm
5549
path: llvm
5650

57-
- name: Build LLVM for tester
58-
uses: matter-labs/era-compiler-ci/.github/actions/build-llvm@v1
51+
- name: Building solc
52+
uses: matter-labs/era-compiler-ci/.github/actions/build-solc@v1
5953
with:
60-
clone-llvm: false
61-
62-
- name: Build compiler-tester
63-
run: |
64-
cargo build --release --target ${TARGET} --bin 'compiler-tester'
65-
rm -rf target-llvm
54+
cmake-build-type: 'Release'
55+
working-dir: 'era-solidity'
56+
upload-testing-binary: false
6657

6758
- name: Build LLVM with coverage
6859
uses: matter-labs/era-compiler-ci/.github/actions/build-llvm@v1
6960
with:
70-
clone-llvm: false
61+
clone-llvm: 'false'
7162
enable-coverage: true
63+
enable-tests: true
64+
enable-assertions: 'false'
65+
ccache-key: ${{ format('llvm-{0}-{1}', runner.os, runner.arch) }}
7266

73-
- name: Build compilers with coverage
67+
- name: Build solx with coverage
68+
uses: matter-labs/era-compiler-ci/.github/actions/build-rust@v1
7469
env:
75-
CARGO_CHECKOUT_DIR: /usr/local/cargo/git/checkouts
76-
RUSTFLAGS: "-C instrument-coverage"
77-
run: |
78-
cargo build --target ${TARGET} \
79-
--manifest-path ${CARGO_CHECKOUT_DIR}/era-compiler-solidity-*/*/Cargo.toml \
80-
--target-dir './target-zksolc/'
81-
cargo build --target ${TARGET} \
82-
--manifest-path ${CARGO_CHECKOUT_DIR}/era-compiler-vyper-*/*/Cargo.toml \
83-
--target-dir './target-zkvyper/'
84-
85-
- name: Run tests with coverage for EraVM
70+
BOOST_PREFIX: ${{ github.workspace }}/era-solidity/boost/lib
71+
SOLC_PREFIX: ${{ github.workspace }}/era-solidity/build
72+
with:
73+
exec_name: 'solx'
74+
target: 'x86_64-unknown-linux-gnu'
75+
release-suffix: test
76+
enable-coverage: true
77+
78+
- name: Running Lit tests
8679
run: |
87-
./target/${TARGET}/release/compiler-tester \
88-
--target eravm \
89-
--zksolc "./target-zksolc/${TARGET}/debug/zksolc" \
90-
--zkvyper "./target-zksolc/${TARGET}/debug/zkvyper" \
91-
--path '${{ inputs.path || env.DEFAULT_BENCHMARKS_PATH }}' \
92-
--mode '${{ inputs.mode || env.LATEST_SOLC_VERSION }}' \
93-
--workflow build
80+
ninja -C './target-llvm/build-final' verify-llvm -v || true
81+
ninja -C './target-llvm/build-final' check-llvm-codegen-evm -v || true
82+
ninja -C './target-llvm/build-final' check-llvm-codegen-generic -v || true
83+
ninja -C './target-llvm/build-final' check-llvm-mc-evm -v || true
84+
ninja -C './target-llvm/build-final' check-llvm-unit -v || true
9485
9586
- name: Generate coverage reports
9687
run: |
97-
llvm-profdata merge -sparse -o ${PROFDATA_FILE} *.profraw
88+
llvm-profdata merge -sparse -o ${PROFDATA_FILE} ./target-llvm/build-final/profiles/*.profraw
9889
llvm-cov show --show-directory-coverage \
9990
--format=html --output-dir=${OUTPUT_HTML_DIR} \
100-
-instr-profile=${PROFDATA_FILE} ./target-zksolc/${TARGET}/debug/zksolc
91+
-instr-profile=${PROFDATA_FILE} ./releases/test/solx-test
10192
llvm-cov export --format=lcov -instr-profile=${PROFDATA_FILE} \
102-
./target-zksolc/${TARGET}/debug/zksolc > ./llvm/${LCOV_FILE}
93+
./releases/test/solx-test > ./${LCOV_FILE}
10394
10495
- name: Upload coverage artifacts
10596
uses: actions/upload-artifact@v4
10697
with:
10798
name: 'Coverage HTML'
108-
path: ${{ env.OUTPUT_HTML_DIR}}
99+
path: ${{ env.OUTPUT_HTML_DIR }}
109100

110101
- name: Upload coverage to Codecov
111102
uses: codecov/codecov-action@v4

0 commit comments

Comments
 (0)