Skip to content

Commit a91b20f

Browse files
committed
ci(lean-imt): run slither only for lean-imt
1 parent abd672d commit a91b20f

File tree

1 file changed

+7
-44
lines changed

1 file changed

+7
-44
lines changed

.github/workflows/main.yml

+7-44
Original file line numberDiff line numberDiff line change
@@ -152,67 +152,30 @@ jobs:
152152
echo "matrix=$matrix" >> $GITHUB_OUTPUT
153153
154154
slither:
155-
if: needs.changed-files.outputs.any_changed == 'true'
156-
needs: [changed-files, set-matrix, deps]
155+
if: contains(needs.changed-files.outputs.modified_files, 'lean-imt')
156+
needs: [changed-files, compile]
157157
runs-on: ubuntu-latest
158158
permissions:
159159
contents: read
160160
security-events: write
161-
strategy:
162-
matrix:
163-
dir: ${{ fromJson(needs.set-matrix.outputs.matrix) }}
164161
steps:
165162
- uses: actions/checkout@v4
166-
167-
# FIXME this does not work as a way to restore compilation results for slither job but it does for the compile job ??
168-
#- uses: actions/download-artifact@v4
169-
# with:
170-
# name: all-artifacts
171-
# path: packages/
172-
173-
- uses: actions/setup-node@v4
174-
with:
175-
node-version: 20
176-
- uses: actions/cache/restore@v4
177-
with:
178-
path: node_modules
179-
key: ${{ needs.deps.outputs.cache-key }}
180-
# TODO: right now forge and node tooling coexist, eventually keep only forge action
181-
- uses: foundry-rs/foundry-toolchain@v1
163+
- uses: actions/download-artifact@v4
182164
with:
183-
version: nightly
184-
185-
- if: contains(needs.changed-files.outputs.modified_files, matrix.dir)
186-
name: Compile contracts
187-
run: |
188-
workspace=$(jq -r '.name' packages/${{ matrix.dir }}/package.json)
189-
yarn workspace "$workspace" run compile
165+
name: all-artifacts-forge
166+
path: packages/
190167

191-
- if: contains(needs.changed-files.outputs.modified_files, matrix.dir) && matrix.dir != 'lean-imt'
192-
name: Run slither
168+
- name: Run slither
193169
uses: crytic/slither-action@v0.4.0
194170
id: slither
195171
with:
196172
ignore-compile: true
197-
node-version: 20
198173
fail-on: none
199174
sarif: results.sarif
200175
slither-args: --filter-paths "test" --exclude-dependencies --markdown-root ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/
201176
target: packages/${{ matrix.dir }}
202177

203-
- if: contains(needs.changed-files.outputs.modified_files, 'lean-imt')
204-
name: Run slither
205-
uses: crytic/slither-action@v0.4.0
206-
id: slither
207-
with:
208-
ignore-compile: true
209-
fail-on: none
210-
sarif: results.sarif
211-
slither-args: --filter-paths "test" --hardhat-ignore-compile --exclude-dependencies --markdown-root ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/
212-
target: packages/lean-imt
213-
214-
- if: contains(needs.changed-files.outputs.modified_files, matrix.dir)
215-
name: Upload SARIF files
178+
- name: Upload SARIF files
216179
uses: github/codeql-action/upload-sarif@v3
217180
with:
218181
sarif_file: ${{ steps.slither.outputs.sarif }}

0 commit comments

Comments
 (0)