|
15 | 15 | pull_request:
|
16 | 16 | branches:
|
17 | 17 | - "*"
|
18 |
| - |
19 |
| -permissions: # added using https://github.com/step-security/secure-workflows |
| 18 | + |
| 19 | +permissions: # added using https://github.com/step-security/secure-workflows |
20 | 20 | contents: read
|
21 | 21 |
|
22 | 22 | jobs:
|
23 |
| - contracts-testing: |
| 23 | + # *********************************************************************************** # |
| 24 | + # ******************************* Hardhat Tests ************************************* # |
| 25 | + # *********************************************************************************** # |
| 26 | + hardhat-tests: |
24 | 27 | runs-on: ubuntu-latest
|
25 | 28 | 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 [email protected] --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 |
| 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 [email protected] --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: Run Hardhat tests |
| 77 | + run: yarn test |
| 78 | + working-directory: contracts |
| 79 | + |
| 80 | + # *********************************************************************************** # |
| 81 | + # ******************************* Foundry Tests ************************************* # |
| 82 | + # *********************************************************************************** # |
| 83 | + # COMPILATION FAILS 🤬 |
| 84 | + # foundry-tests: |
| 85 | + # runs-on: ubuntu-latest |
| 86 | + # steps: |
| 87 | + # - name: Harden Runner |
| 88 | + # uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 |
| 89 | + # with: |
| 90 | + # disable-sudo: false |
| 91 | + # egress-policy: block |
| 92 | + # allowed-endpoints: > |
| 93 | + # binaries.soliditylang.org:443 |
| 94 | + # classic.yarnpkg.com:443 |
| 95 | + # github.com:443 |
| 96 | + # nightly.yarnpkg.com:443 |
| 97 | + # nodejs.org:443 |
| 98 | + # objects.githubusercontent.com:443 |
| 99 | + # registry.yarnpkg.com:443 |
| 100 | + # registry.npmjs.org:443 |
| 101 | + # 54.185.253.63:443 |
| 102 | + |
| 103 | + # - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 104 | + # with: |
| 105 | + # submodules: recursive |
| 106 | + |
| 107 | + # - name: Set up corepack (for yarn) |
| 108 | + # run: | |
| 109 | + # corepack enable |
| 110 | + # corepack prepare [email protected] --activate |
| 111 | + # yarn set version 4.9.2 |
| 112 | + |
| 113 | + # - name: Setup Node.js environment |
| 114 | + # uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 |
| 115 | + # with: |
| 116 | + # node-version: 20.x |
| 117 | + # cache: yarn |
| 118 | + |
| 119 | + # - name: Cache node modules |
| 120 | + # uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1 |
| 121 | + # env: |
| 122 | + # cache-name: cache-node-modules |
| 123 | + # with: |
| 124 | + # path: | |
| 125 | + # ~/.npm |
| 126 | + # **/node_modules |
| 127 | + # key: ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }} |
| 128 | + # restore-keys: | |
| 129 | + # ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}- |
| 130 | + |
| 131 | + # # - name: Install contracts dependencies |
| 132 | + # # run: yarn workspace @kleros/kleros-v2-contracts install |
| 133 | + |
| 134 | + # - name: Install Foundry |
| 135 | + # uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0 |
| 136 | + |
| 137 | + # - name: Run Foundry tests |
| 138 | + # run: forge test --config-path ./foundry.toml |
| 139 | + # working-directory: contracts |
| 140 | + |
| 141 | + # - name: Run snapshot |
| 142 | + # run: NO_COLOR=1 forge snapshot >> $GITHUB_STEP_SUMMARY |
| 143 | + # working-directory: contracts |
0 commit comments