|
| 1 | +name: Checks |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - master |
| 10 | + |
| 11 | +env: |
| 12 | + WORKING_DIR: contracts/internal/host-chain |
| 13 | + KEY: "0x0000000000000000000000000000000000000000000000000000000000000001" |
| 14 | + KEY2: "0x0000000000000000000000000000000000000000000000000000000000000002" |
| 15 | + AGGREGATOR_KEY: "0x0000000000000000000000000000000000000000000000000000000000000003" |
| 16 | + |
| 17 | +jobs: |
| 18 | + lint-solhint: |
| 19 | + name: Solhint Lint |
| 20 | + runs-on: ubuntu-latest |
| 21 | + defaults: |
| 22 | + run: |
| 23 | + working-directory: contracts/internal/host-chain |
| 24 | + steps: |
| 25 | + - name: Checkout repository |
| 26 | + uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Setup Node.js |
| 29 | + uses: actions/setup-node@v4 |
| 30 | + with: |
| 31 | + node-version: "20" |
| 32 | + |
| 33 | + - name: Install pnpm |
| 34 | + uses: pnpm/action-setup@v2 |
| 35 | + with: |
| 36 | + version: 9 |
| 37 | + |
| 38 | + - name: Get pnpm store directory |
| 39 | + shell: bash |
| 40 | + run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
| 41 | + |
| 42 | + - name: Setup pnpm cache |
| 43 | + uses: actions/cache@v4 |
| 44 | + with: |
| 45 | + path: ${{ env.STORE_PATH }} |
| 46 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('contracts/internal/host-chain/pnpm-lock.yaml') }} |
| 47 | + restore-keys: | |
| 48 | + ${{ runner.os }}-pnpm-store- |
| 49 | +
|
| 50 | + - name: Install dependencies |
| 51 | + run: pnpm install |
| 52 | + |
| 53 | + - name: Run Solhint |
| 54 | + run: pnpm lint:sol |
| 55 | + |
| 56 | + storage-layout: |
| 57 | + name: Storage Layout Check |
| 58 | + runs-on: ubuntu-latest |
| 59 | + defaults: |
| 60 | + run: |
| 61 | + working-directory: contracts/internal/host-chain |
| 62 | + steps: |
| 63 | + - name: Checkout repository |
| 64 | + uses: actions/checkout@v4 |
| 65 | + |
| 66 | + - name: Setup Node.js |
| 67 | + uses: actions/setup-node@v4 |
| 68 | + with: |
| 69 | + node-version: "20" |
| 70 | + |
| 71 | + - name: Install pnpm |
| 72 | + uses: pnpm/action-setup@v2 |
| 73 | + with: |
| 74 | + version: 9 |
| 75 | + |
| 76 | + - name: Get pnpm store directory |
| 77 | + shell: bash |
| 78 | + run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
| 79 | + |
| 80 | + - name: Setup pnpm cache |
| 81 | + uses: actions/cache@v4 |
| 82 | + with: |
| 83 | + path: ${{ env.STORE_PATH }} |
| 84 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('contracts/internal/host-chain/pnpm-lock.yaml') }} |
| 85 | + restore-keys: | |
| 86 | + ${{ runner.os }}-pnpm-store- |
| 87 | +
|
| 88 | + - name: Install dependencies |
| 89 | + run: pnpm install |
| 90 | + |
| 91 | + - name: Compile contracts |
| 92 | + run: pnpm compile |
| 93 | + |
| 94 | + - name: Check storage layout |
| 95 | + run: pnpm storage-layout:check |
| 96 | + |
| 97 | + contract-size: |
| 98 | + name: Contract Size Check |
| 99 | + runs-on: ubuntu-latest |
| 100 | + defaults: |
| 101 | + run: |
| 102 | + working-directory: contracts/internal/host-chain |
| 103 | + steps: |
| 104 | + - name: Checkout repository |
| 105 | + uses: actions/checkout@v4 |
| 106 | + |
| 107 | + - name: Setup Node.js |
| 108 | + uses: actions/setup-node@v4 |
| 109 | + with: |
| 110 | + node-version: "20" |
| 111 | + |
| 112 | + - name: Install pnpm |
| 113 | + uses: pnpm/action-setup@v2 |
| 114 | + with: |
| 115 | + version: 9 |
| 116 | + |
| 117 | + - name: Get pnpm store directory |
| 118 | + shell: bash |
| 119 | + run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
| 120 | + |
| 121 | + - name: Setup pnpm cache |
| 122 | + uses: actions/cache@v4 |
| 123 | + with: |
| 124 | + path: ${{ env.STORE_PATH }} |
| 125 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('contracts/internal/host-chain/pnpm-lock.yaml') }} |
| 126 | + restore-keys: | |
| 127 | + ${{ runner.os }}-pnpm-store- |
| 128 | +
|
| 129 | + - name: Install dependencies |
| 130 | + run: pnpm install |
| 131 | + |
| 132 | + - name: Compile contracts |
| 133 | + run: pnpm compile |
| 134 | + |
| 135 | + - name: Check contract sizes |
| 136 | + run: pnpm check:size |
| 137 | + |
| 138 | + slither: |
| 139 | + name: Slither Analysis |
| 140 | + runs-on: ubuntu-latest |
| 141 | + defaults: |
| 142 | + run: |
| 143 | + working-directory: contracts/internal/host-chain |
| 144 | + steps: |
| 145 | + - name: Checkout repository |
| 146 | + uses: actions/checkout@v4 |
| 147 | + |
| 148 | + - name: Setup Node.js |
| 149 | + uses: actions/setup-node@v4 |
| 150 | + with: |
| 151 | + node-version: "20" |
| 152 | + |
| 153 | + - name: Install pnpm |
| 154 | + uses: pnpm/action-setup@v2 |
| 155 | + with: |
| 156 | + version: 9 |
| 157 | + |
| 158 | + - name: Get pnpm store directory |
| 159 | + shell: bash |
| 160 | + run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
| 161 | + |
| 162 | + - name: Setup pnpm cache |
| 163 | + uses: actions/cache@v4 |
| 164 | + with: |
| 165 | + path: ${{ env.STORE_PATH }} |
| 166 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('contracts/internal/host-chain/pnpm-lock.yaml') }} |
| 167 | + restore-keys: | |
| 168 | + ${{ runner.os }}-pnpm-store- |
| 169 | +
|
| 170 | + - name: Install dependencies |
| 171 | + run: pnpm install |
| 172 | + |
| 173 | + - name: Compile contracts |
| 174 | + run: pnpm compile |
| 175 | + |
| 176 | + - name: Run Slither |
| 177 | + uses: crytic/slither-action@v0.4.0 |
| 178 | + with: |
| 179 | + target: contracts/internal/host-chain |
| 180 | + solc-version: "0.8.25" |
| 181 | + slither-config: contracts/internal/host-chain/slither.config.json |
| 182 | + fail-on: medium |
| 183 | + |
| 184 | + gas-report: |
| 185 | + name: Gas Report |
| 186 | + runs-on: ubuntu-latest |
| 187 | + defaults: |
| 188 | + run: |
| 189 | + working-directory: contracts/internal/host-chain |
| 190 | + steps: |
| 191 | + - name: Checkout repository |
| 192 | + uses: actions/checkout@v4 |
| 193 | + |
| 194 | + - name: Setup Node.js |
| 195 | + uses: actions/setup-node@v4 |
| 196 | + with: |
| 197 | + node-version: "20" |
| 198 | + |
| 199 | + - name: Install pnpm |
| 200 | + uses: pnpm/action-setup@v2 |
| 201 | + with: |
| 202 | + version: 9 |
| 203 | + |
| 204 | + - name: Get pnpm store directory |
| 205 | + shell: bash |
| 206 | + run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
| 207 | + |
| 208 | + - name: Setup pnpm cache |
| 209 | + uses: actions/cache@v4 |
| 210 | + with: |
| 211 | + path: ${{ env.STORE_PATH }} |
| 212 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('contracts/internal/host-chain/pnpm-lock.yaml') }} |
| 213 | + restore-keys: | |
| 214 | + ${{ runner.os }}-pnpm-store- |
| 215 | +
|
| 216 | + - name: Install dependencies |
| 217 | + run: pnpm install |
| 218 | + |
| 219 | + - name: Run tests with gas reporting |
| 220 | + run: pnpm test |
| 221 | + env: |
| 222 | + REPORT_GAS: "true" |
| 223 | + GAS_REPORT_FILE: gas-report.txt |
| 224 | + |
| 225 | + - name: Upload gas report |
| 226 | + uses: actions/upload-artifact@v4 |
| 227 | + if: always() |
| 228 | + with: |
| 229 | + name: gas-report |
| 230 | + path: contracts/internal/host-chain/gas-report.txt |
| 231 | + retention-days: 30 |
0 commit comments