Skip to content

Commit ef3a64c

Browse files
committed
chore: github contract testing workflow without coverage due to via-ir issues
1 parent b490c96 commit ef3a64c

File tree

1 file changed

+119
-65
lines changed

1 file changed

+119
-65
lines changed

.github/workflows/contracts-testing.yml

Lines changed: 119 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -15,73 +15,127 @@ on:
1515
pull_request:
1616
branches:
1717
- "*"
18-
19-
permissions: # added using https://github.com/step-security/secure-workflows
18+
19+
permissions: # added using https://github.com/step-security/secure-workflows
2020
contents: read
2121

2222
jobs:
23-
contracts-testing:
23+
# *********************************************************************************** #
24+
# ******************************* Hardhat Tests ************************************* #
25+
# *********************************************************************************** #
26+
hardhat-tests:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Harden Runner
30+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
31+
with:
32+
disable-sudo: false
33+
egress-policy: block
34+
allowed-endpoints: >
35+
binaries.soliditylang.org:443
36+
classic.yarnpkg.com:443
37+
github.com:443
38+
nightly.yarnpkg.com:443
39+
nodejs.org:443
40+
objects.githubusercontent.com:443
41+
registry.yarnpkg.com:443
42+
registry.npmjs.org:443
43+
54.185.253.63:443
44+
45+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46+
with:
47+
submodules: recursive
48+
49+
- name: Set up corepack (for yarn)
50+
run: |
51+
corepack enable
52+
corepack prepare yarn@4.9.2 --activate
53+
yarn set version 4.9.2
54+
55+
- name: Setup Node.js environment
56+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
57+
with:
58+
node-version: 20.x
59+
cache: yarn
60+
61+
- name: Cache node modules
62+
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
63+
env:
64+
cache-name: cache-node-modules
65+
with:
66+
path: |
67+
~/.npm
68+
**/node_modules
69+
key: ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
70+
restore-keys: |
71+
${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
72+
73+
- name: Install contracts dependencies
74+
run: yarn workspace @kleros/kleros-v2-contracts install
75+
76+
- name: Install Foundry
77+
uses: foundry-rs/foundry-toolchain@de808b1eea699e761c404bda44ba8f21aba30b2c # v1.3.1
78+
79+
- name: Run Hardhat tests
80+
run: yarn test
81+
working-directory: contracts
82+
83+
# *********************************************************************************** #
84+
# ******************************* Foundry Tests ************************************* #
85+
# *********************************************************************************** #
86+
foundry-tests:
2487
runs-on: ubuntu-latest
2588
steps:
26-
- name: Harden Runner
27-
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
28-
with:
29-
disable-sudo: false
30-
egress-policy: block
31-
allowed-endpoints: >
32-
binaries.soliditylang.org:443
33-
classic.yarnpkg.com:443
34-
github.com:443
35-
nightly.yarnpkg.com:443
36-
nodejs.org:443
37-
objects.githubusercontent.com:443
38-
registry.yarnpkg.com:443
39-
registry.npmjs.org:443
40-
54.185.253.63:443
41-
42-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
43-
with:
44-
submodules: recursive
45-
46-
- name: Set up corepack (for yarn)
47-
run: |
48-
corepack enable
49-
corepack prepare yarn@4.9.2 --activate
50-
yarn set version 4.9.2
51-
52-
- name: Setup Node.js environment
53-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
54-
with:
55-
node-version: 20.x
56-
cache: yarn
57-
58-
- name: Cache node modules
59-
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
60-
env:
61-
cache-name: cache-node-modules
62-
with:
63-
path: |
64-
~/.npm
65-
**/node_modules
66-
key: ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
67-
restore-keys: |
68-
${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
69-
70-
- name: Install contracts dependencies
71-
run: yarn workspace @kleros/kleros-v2-contracts install
72-
73-
- name: Install Foundry
74-
uses: foundry-rs/foundry-toolchain@de808b1eea699e761c404bda44ba8f21aba30b2c # v1.3.1
75-
76-
- name: Install lcov
77-
run: sudo apt-get install -y lcov
78-
79-
- name: Run Hardhat and Foundry tests with coverage
80-
run: yarn coverage
81-
working-directory: contracts
82-
83-
- name: Upload a build artifact
84-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
85-
with:
86-
name: code-coverage-report
87-
path: contracts/coverage
89+
- name: Harden Runner
90+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
91+
with:
92+
disable-sudo: false
93+
egress-policy: block
94+
allowed-endpoints: >
95+
binaries.soliditylang.org:443
96+
classic.yarnpkg.com:443
97+
github.com:443
98+
nightly.yarnpkg.com:443
99+
nodejs.org:443
100+
objects.githubusercontent.com:443
101+
registry.yarnpkg.com:443
102+
registry.npmjs.org:443
103+
54.185.253.63:443
104+
105+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
106+
with:
107+
submodules: recursive
108+
109+
- name: Set up corepack (for yarn)
110+
run: |
111+
corepack enable
112+
corepack prepare yarn@4.9.2 --activate
113+
yarn set version 4.9.2
114+
115+
- name: Setup Node.js environment
116+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
117+
with:
118+
node-version: 20.x
119+
cache: yarn
120+
121+
- name: Cache node modules
122+
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
123+
env:
124+
cache-name: cache-node-modules
125+
with:
126+
path: |
127+
~/.npm
128+
**/node_modules
129+
key: ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
130+
restore-keys: |
131+
${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
132+
133+
- name: Install contracts dependencies
134+
run: yarn workspace @kleros/kleros-v2-contracts install
135+
136+
- name: Install Foundry
137+
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0
138+
139+
- name: Run Foundry tests
140+
run: forge test
141+
working-directory: contracts

0 commit comments

Comments
 (0)