11name : CI
22
3+ permissions : {}
4+
35on :
46 workflow_dispatch :
57 pull_request :
1214 name : build +${{ matrix.toolchain }} ${{ matrix.flags }}
1315 runs-on : ubuntu-latest
1416 timeout-minutes : 10
17+ permissions :
18+ contents : read
1519 strategy :
1620 fail-fast : false
1721 matrix :
@@ -27,23 +31,37 @@ jobs:
2731 - --use solc:0.6.2
2832 - --use solc:0.6.12
2933 steps :
30- - uses : actions/checkout@v4
34+ - uses : actions/checkout@v5
35+ with :
36+ persist-credentials : false
3137 - uses : foundry-rs/foundry-toolchain@v1
3238 - run : forge --version
33- - run : forge build --skip test --deny-warnings ${{ matrix.flags }}
39+ - run : |
40+ case "${{ matrix.flags }}" in
41+ *"solc:0.8.0"* | *"solc:0.7"* | *"solc:0.6"*)
42+ forge build --skip test --skip Config --skip StdConfig --skip LibVariable --deny-warnings ${{ matrix.flags }}
43+ ;;
44+ *)
45+ forge build --skip test --deny-warnings ${{ matrix.flags }}
46+ ;;
47+ esac
3448 # via-ir compilation time checks.
3549 - if : contains(matrix.flags, '--via-ir')
3650 run : forge build --skip test --deny-warnings ${{ matrix.flags }} --contracts 'test/compilation/*'
3751
3852 test :
3953 runs-on : ubuntu-latest
4054 timeout-minutes : 10
55+ permissions :
56+ contents : read
4157 strategy :
4258 fail-fast : false
4359 matrix :
4460 toolchain : [stable, nightly]
4561 steps :
46- - uses : actions/checkout@v4
62+ - uses : actions/checkout@v5
63+ with :
64+ persist-credentials : false
4765 - uses : foundry-rs/foundry-toolchain@v1
4866 with :
4967 version : ${{ matrix.toolchain }}
@@ -53,18 +71,54 @@ jobs:
5371 fmt :
5472 runs-on : ubuntu-latest
5573 timeout-minutes : 10
74+ permissions :
75+ contents : read
5676 steps :
57- - uses : actions/checkout@v4
77+ - uses : actions/checkout@v5
78+ with :
79+ persist-credentials : false
5880 - uses : foundry-rs/foundry-toolchain@v1
5981 - run : forge --version
6082 - run : forge fmt --check
6183
6284 typos :
6385 runs-on : ubuntu-latest
6486 timeout-minutes : 10
87+ permissions :
88+ contents : read
89+ steps :
90+ - uses : actions/checkout@v5
91+ with :
92+ persist-credentials : false
93+ - uses : crate-ci/typos@80c8a4945eec0f6d464eaf9e65ed98ef085283d1 # v1
94+
95+ codeql :
96+ name : Analyze (${{ matrix.language }})
97+ runs-on : ubuntu-latest
98+ permissions :
99+ security-events : write
100+ actions : read
101+ contents : read
102+ strategy :
103+ fail-fast : false
104+ matrix :
105+ include :
106+ - language : actions
107+ build-mode : none
65108 steps :
66- - uses : actions/checkout@v4
67- - uses : crate-ci/typos@v1
109+ - name : Checkout repository
110+ uses : actions/checkout@v5
111+ with :
112+ persist-credentials : false
113+ - name : Initialize CodeQL
114+ uses : github/codeql-action/init@v4
115+ with :
116+ languages : ${{ matrix.language }}
117+ build-mode : ${{ matrix.build-mode }}
118+ - name : Perform CodeQL Analysis
119+ uses : github/codeql-action/analyze@v4
120+ with :
121+ category : " /language:${{matrix.language}}"
68122
69123 ci-success :
70124 runs-on : ubuntu-latest
@@ -74,9 +128,10 @@ jobs:
74128 - test
75129 - fmt
76130 - typos
131+ - codeql
77132 timeout-minutes : 10
78133 steps :
79134 - name : Decide whether the needed jobs succeeded or failed
80- uses : re-actors/alls-green@release/v1
135+ uses : re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1
81136 with :
82137 jobs : ${{ toJSON(needs) }}
0 commit comments