-
Notifications
You must be signed in to change notification settings - Fork 55
143 lines (125 loc) · 4.78 KB
/
contracts-testing.yml
File metadata and controls
143 lines (125 loc) · 4.78 KB
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
name: Contracts Testing
on:
workflow_dispatch:
merge_group:
push:
branches:
- master
- dev
paths-ignore:
- "kleros-sdk/**"
- "services/**"
- "subgraph/**"
- "web/**"
pull_request:
branches:
- "*"
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
# *********************************************************************************** #
# ******************************* Hardhat Tests ************************************* #
# *********************************************************************************** #
hardhat-tests:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
disable-sudo: false
egress-policy: block
allowed-endpoints: >
binaries.soliditylang.org:443
classic.yarnpkg.com:443
github.com:443
nightly.yarnpkg.com:443
nodejs.org:443
objects.githubusercontent.com:443
registry.yarnpkg.com:443
registry.npmjs.org:443
54.185.253.63:443
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Set up corepack (for yarn)
run: |
corepack enable
corepack prepare yarn@4.9.2 --activate
yarn set version 4.9.2
- name: Setup Node.js environment
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: 20.x
cache: yarn
- name: Cache node modules
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
- name: Install contracts dependencies
run: yarn workspace @kleros/kleros-v2-contracts install
- name: Run Hardhat tests
run: yarn test
working-directory: contracts
# *********************************************************************************** #
# ******************************* Foundry Tests ************************************* #
# *********************************************************************************** #
# COMPILATION FAILS 🤬
# foundry-tests:
# runs-on: ubuntu-latest
# steps:
# - name: Harden Runner
# uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
# with:
# disable-sudo: false
# egress-policy: block
# allowed-endpoints: >
# binaries.soliditylang.org:443
# classic.yarnpkg.com:443
# github.com:443
# nightly.yarnpkg.com:443
# nodejs.org:443
# objects.githubusercontent.com:443
# registry.yarnpkg.com:443
# registry.npmjs.org:443
# 54.185.253.63:443
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# with:
# submodules: recursive
# - name: Set up corepack (for yarn)
# run: |
# corepack enable
# corepack prepare yarn@4.9.2 --activate
# yarn set version 4.9.2
# - name: Setup Node.js environment
# uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
# with:
# node-version: 20.x
# cache: yarn
# - name: Cache node modules
# uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
# env:
# cache-name: cache-node-modules
# with:
# path: |
# ~/.npm
# **/node_modules
# key: ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
# # - name: Install contracts dependencies
# # run: yarn workspace @kleros/kleros-v2-contracts install
# - name: Install Foundry
# uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0
# - name: Run Foundry tests
# run: forge test --config-path ./foundry.toml
# working-directory: contracts
# - name: Run snapshot
# run: NO_COLOR=1 forge snapshot >> $GITHUB_STEP_SUMMARY
# working-directory: contracts