Skip to content

Commit 6b8ebe0

Browse files
Merge pull request #3126 from OffchainLabs/fix-workflows
Cleanup github actions
2 parents 7fdc568 + ec1fbcd commit 6b8ebe0

File tree

4 files changed

+93
-63
lines changed

4 files changed

+93
-63
lines changed

.github/workflows/arbitrator-ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ jobs:
121121
122122
- name: Install Foundry
123123
uses: foundry-rs/foundry-toolchain@v1
124+
with:
125+
cache: false
124126

125127
- name: Cache cbrotli
126128
uses: actions/cache@v3
@@ -132,8 +134,7 @@ jobs:
132134
target/lib/libbrotlicommon-static.a
133135
target/lib/libbrotlienc-static.a
134136
target/lib/libbrotlidec-static.a
135-
key: ${{ runner.os }}-brotli-3-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}
136-
restore-keys: ${{ runner.os }}-brotli-2-
137+
key: ${{ runner.os }}-brotli-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}
137138

138139
- name: Build cbrotli-local
139140
if: steps.cache-cbrotli.outputs.cache-hit != 'true'

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ jobs:
7474

7575
- name: Install Foundry
7676
uses: foundry-rs/foundry-toolchain@v1
77+
with:
78+
cache: false
7779

7880
- name: Install cbindgen
7981
run: cargo install --force cbindgen
@@ -82,10 +84,9 @@ jobs:
8284
uses: actions/cache@v3
8385
with:
8486
path: |
85-
~/go/pkg/mod
8687
~/.cache/go-build
87-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ matrix.test-mode }}
88-
restore-keys: ${{ runner.os }}-go-
88+
key: ${{ runner.os }}-go-${{ matrix.test-mode }}-${{ hashFiles('**/go.sum') }}
89+
restore-keys: ${{ runner.os }}-go-${{ matrix.test-mode }}-
8990

9091
- name: Cache Rust Build Products
9192
uses: actions/cache@v3
@@ -97,8 +98,8 @@ jobs:
9798
arbitrator/wasm-libraries/soft-float/
9899
target/etc/initial-machine-cache/
99100
/home/runner/.rustup/toolchains/
100-
key: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}-min-${{ hashFiles('arbitrator/Cargo.lock') }}-${{ matrix.test-mode }}
101-
restore-keys: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}-
101+
key: ${{ runner.os }}-cargo-${{ matrix.test-mode }}-${{ steps.install-rust.outputs.rustc_hash }}-min-${{ hashFiles('arbitrator/Cargo.lock') }}
102+
restore-keys: ${{ runner.os }}-cargo-${{ matrix.test-mode }}-${{ steps.install-rust.outputs.rustc_hash }}-
102103

103104
- name: Cache cbrotli
104105
uses: actions/cache@v3
@@ -110,8 +111,7 @@ jobs:
110111
target/lib/libbrotlicommon-static.a
111112
target/lib/libbrotlienc-static.a
112113
target/lib/libbrotlidec-static.a
113-
key: ${{ runner.os }}-brotli-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}-${{ matrix.test-mode }}
114-
restore-keys: ${{ runner.os }}-brotli-
114+
key: ${{ runner.os }}-brotli-${{ matrix.test-mode }}-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}
115115

116116
- name: Build cbrotli-local
117117
if: steps.cache-cbrotli.outputs.cache-hit != 'true'

.github/workflows/codeql-analysis.yml

Lines changed: 68 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,13 @@ jobs:
3636

3737
strategy:
3838
fail-fast: false
39+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
40+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
3941
matrix:
40-
language: [ 'go' ]
41-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
42-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
42+
include:
43+
# Analyze Go code
44+
- language: go
45+
build-mode: manual
4346

4447
steps:
4548
- name: Checkout
@@ -50,19 +53,6 @@ jobs:
5053
- name: Install dependencies
5154
run: sudo apt update && sudo apt install -y wabt
5255

53-
# Initializes the CodeQL tools for scanning.
54-
- name: Initialize CodeQL
55-
uses: github/codeql-action/init@v2
56-
with:
57-
languages: ${{ matrix.language }}
58-
# If you wish to specify custom queries, you can do so here or in a config file.
59-
# By default, queries listed here will override any specified in a config file.
60-
# Prefix the list here with "+" to use these queries and those in the config file.
61-
62-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
63-
# queries: security-extended,security-and-quality
64-
config-file: ./.github/codeql/codeql-config.yml
65-
6656
- name: Setup nodejs
6757
uses: actions/setup-node@v3
6858
with:
@@ -75,33 +65,49 @@ jobs:
7565
with:
7666
go-version: 1.23.x
7767

68+
- name: Install wasm-ld
69+
run: |
70+
sudo apt-get update && sudo apt-get install -y lld-14
71+
sudo ln -s /usr/bin/wasm-ld-14 /usr/local/bin/wasm-ld
72+
7873
- name: Install rust stable
7974
uses: dtolnay/rust-toolchain@stable
75+
id: install-rust
76+
with:
77+
toolchain: '1.84.1'
78+
targets: 'wasm32-wasip1, wasm32-unknown-unknown'
79+
components: 'llvm-tools-preview, rustfmt, clippy'
80+
81+
- name: Install rust nightly
82+
uses: dtolnay/rust-toolchain@nightly
83+
id: install-rust-nightly
84+
with:
85+
toolchain: 'nightly-2025-02-14'
86+
targets: 'wasm32-wasip1, wasm32-unknown-unknown'
87+
components: 'rust-src, rustfmt, clippy'
8088

8189
- name: Install Foundry
8290
uses: foundry-rs/foundry-toolchain@v1
83-
91+
with:
92+
cache: false
93+
8494
- name: Install cbindgen
8595
run: cargo install --force cbindgen
8696

87-
- name: Cache Rust Build Products
97+
- name: Cache Build Products
8898
uses: actions/cache@v3
8999
with:
90100
path: |
91-
~/.cargo/
92-
arbitrator/target/
93-
arbitrator/wasm-libraries/target/
94-
arbitrator/wasm-libraries/soft-float/SoftFloat/build
95-
target/etc/initial-machine-cache/
96-
key: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}-min-${{ hashFiles('arbitrator/Cargo.lock') }}
97-
restore-keys: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}-
101+
~/.cache/go-build
102+
key: ${{ runner.os }}-go-${{ matrix.language }}-${{ hashFiles('**/go.sum') }}
103+
restore-keys: ${{ runner.os }}-go-${{ matrix.language }}-
98104

99105
- name: Cache wabt build
100106
id: cache-wabt
101107
uses: actions/cache@v3
102108
with:
103109
path: ~/wabt-prefix
104-
key: ${{ runner.os }}-wabt-codeql-${{ env.WABT_VERSION }}
110+
key: ${{ runner.os }}-wabt-codeql-${{ matrix.language }}-${{ env.WABT_VERSION }}
105111

106112
- name: Cache cbrotli
107113
uses: actions/cache@v3
@@ -113,24 +119,44 @@ jobs:
113119
target/lib/libbrotlicommon-static.a
114120
target/lib/libbrotlienc-static.a
115121
target/lib/libbrotlidec-static.a
116-
key: ${{ runner.os }}-brotli-3a-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}
117-
restore-keys: ${{ runner.os }}-brotli-
122+
key: ${{ runner.os }}-brotli-${{ matrix.language }}-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}
123+
124+
- name: Cache Rust Build Products
125+
uses: actions/cache@v3
126+
with:
127+
path: |
128+
~/.cargo/
129+
arbitrator/target/
130+
arbitrator/wasm-libraries/target/
131+
arbitrator/wasm-libraries/soft-float/SoftFloat/build
132+
target/etc/initial-machine-cache/
133+
key: ${{ runner.os }}-cargo-${{ matrix.language }}-${{ steps.install-rust.outputs.rustc_hash }}-min-${{ hashFiles('arbitrator/Cargo.lock') }}
134+
restore-keys: ${{ runner.os }}-cargo-${{ matrix.language }}-${{ steps.install-rust.outputs.rustc_hash }}-
135+
136+
# Initializes the CodeQL tools for scanning.
137+
- name: Initialize CodeQL
138+
uses: github/codeql-action/init@v3
139+
with:
140+
languages: ${{ matrix.language }}
141+
build-mode: ${{ matrix.build-mode }}
142+
# If you wish to specify custom queries, you can do so here or in a config file.
143+
# By default, queries listed here will override any specified in a config file.
144+
# Prefix the list here with "+" to use these queries and those in the config file.
145+
146+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
147+
# queries: security-extended,security-and-quality
148+
config-file: ./.github/codeql/codeql-config.yml
118149

119150
- name: Build cbrotli-local
120151
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
121152
run: ./scripts/build-brotli.sh -l
122153

123-
- name: Cache Build Products
124-
uses: actions/cache@v3
125-
with:
126-
path: |
127-
~/go/pkg/mod
128-
~/.cache/go-build
129-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
130-
restore-keys: ${{ runner.os }}-go-
154+
- name: Build cbrotli-wasm in docker
155+
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
156+
run: ./scripts/build-brotli.sh -w -d
131157

132-
- name: Build all lint dependencies
133-
run: make -j build-node-deps
158+
- name: Build Nitro for CodeQL
159+
run: make build -j
134160

135161
# ℹ️ Command-line programs to run using the OS shell.
136162
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -143,4 +169,7 @@ jobs:
143169
# ./location_of_script_within_repo/buildscript.sh
144170

145171
- name: Perform CodeQL Analysis
146-
uses: github/codeql-action/analyze@v2
172+
uses: github/codeql-action/analyze@v3
173+
with:
174+
category: "/language:${{ matrix.language }}"
175+

.github/workflows/nightly-ci.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ jobs:
7878

7979
- name: Install Foundry
8080
uses: foundry-rs/foundry-toolchain@v1
81+
with:
82+
cache: false
8183

8284
- name: Install cbindgen
8385
run: cargo install --force cbindgen
@@ -86,10 +88,9 @@ jobs:
8688
uses: actions/cache@v3
8789
with:
8890
path: |
89-
~/go/pkg/mod
9091
~/.cache/go-build
91-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ matrix.test-mode }}
92-
restore-keys: ${{ runner.os }}-go-
92+
key: ${{ runner.os }}-go-${{ matrix.test-mode }}-${{ hashFiles('**/go.sum') }}
93+
restore-keys: ${{ runner.os }}-go-${{ matrix.test-mode }}-
9394

9495
- name: Cache Rust Build Products
9596
uses: actions/cache@v3
@@ -101,8 +102,8 @@ jobs:
101102
arbitrator/wasm-libraries/soft-float/
102103
target/etc/initial-machine-cache/
103104
/home/runner/.rustup/toolchains/
104-
key: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}-min-${{ hashFiles('arbitrator/Cargo.lock') }}-${{ matrix.test-mode }}
105-
restore-keys: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}-
105+
key: ${{ runner.os }}-cargo-${{ matrix.test-mode }}-${{ steps.install-rust.outputs.rustc_hash }}-min-${{ hashFiles('arbitrator/Cargo.lock') }}
106+
restore-keys: ${{ runner.os }}-cargo-${{ matrix.test-mode }}-${{ steps.install-rust.outputs.rustc_hash }}-
106107

107108
- name: Cache cbrotli
108109
uses: actions/cache@v3
@@ -114,8 +115,7 @@ jobs:
114115
target/lib/libbrotlicommon-static.a
115116
target/lib/libbrotlienc-static.a
116117
target/lib/libbrotlidec-static.a
117-
key: ${{ runner.os }}-brotli-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}-${{ matrix.test-mode }}
118-
restore-keys: ${{ runner.os }}-brotli-
118+
key: ${{ runner.os }}-brotli-${{ matrix.test-mode }}-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}
119119

120120
- name: Build cbrotli-local
121121
run: ./scripts/build-brotli.sh -l
@@ -254,6 +254,8 @@ jobs:
254254
- name: Install Foundry
255255
if: steps.changed-files.outputs.any_changed == 'true'
256256
uses: foundry-rs/foundry-toolchain@v1
257+
with:
258+
cache: false
257259

258260
- name: Install cbindgen
259261
if: steps.changed-files.outputs.any_changed == 'true'
@@ -264,10 +266,9 @@ jobs:
264266
uses: actions/cache@v3
265267
with:
266268
path: |
267-
~/go/pkg/mod
268269
~/.cache/go-build
269-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ matrix.test-mode }}
270-
restore-keys: ${{ runner.os }}-go-
270+
key: ${{ runner.os }}-go-${{ matrix.test-mode }}-${{ hashFiles('**/go.sum') }}
271+
restore-keys: ${{ runner.os }}-go-${{ matrix.test-mode }}-
271272

272273
- name: Cache Rust Build Products
273274
if: steps.changed-files.outputs.any_changed == 'true'
@@ -280,8 +281,8 @@ jobs:
280281
arbitrator/wasm-libraries/soft-float/
281282
target/etc/initial-machine-cache/
282283
/home/runner/.rustup/toolchains/
283-
key: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}-min-${{ hashFiles('arbitrator/Cargo.lock') }}-${{ matrix.test-mode }}
284-
restore-keys: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.rustc_hash }}-
284+
key: ${{ runner.os }}-cargo-${{ matrix.test-mode }}-${{ steps.install-rust.outputs.rustc_hash }}-min-${{ hashFiles('arbitrator/Cargo.lock') }}
285+
restore-keys: ${{ runner.os }}-cargo-${{ matrix.test-mode }}-${{ steps.install-rust.outputs.rustc_hash }}-
285286

286287
- name: Cache cbrotli
287288
if: steps.changed-files.outputs.any_changed == 'true'
@@ -294,8 +295,7 @@ jobs:
294295
target/lib/libbrotlicommon-static.a
295296
target/lib/libbrotlienc-static.a
296297
target/lib/libbrotlidec-static.a
297-
key: ${{ runner.os }}-brotli-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}-${{ matrix.test-mode }}
298-
restore-keys: ${{ runner.os }}-brotli-
298+
key: ${{ runner.os }}-brotli-${{ matrix.test-mode }}-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}
299299

300300
- name: Build cbrotli-local
301301
if: steps.changed-files.outputs.any_changed == 'true' && steps.cache-cbrotli.outputs.cache-hit != 'true'
@@ -368,4 +368,4 @@ jobs:
368368
token: ${{ secrets.SLACK_BOT_TOKEN }}
369369
payload: |
370370
"channel": "${{ secrets.SLACK_CHANNEL_ID }}",
371-
"text": "⚠️ CI job failed! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
371+
"text": "⚠️ CI job failed! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",

0 commit comments

Comments
 (0)