Skip to content

Commit e17fd69

Browse files
authored
ci: extract lint into reusable workflow for early fail-fast (#983)
* ci: extract lint into standalone workflow with workflow_run gating * ci: gate coverage workflow behind lint via workflow_run * ci: revert to reusable workflow approach to avoid workflow_run security issues * fix: use SubstrateTestNode instead of undeclared TestNode
1 parent 1349c38 commit e17fd69

5 files changed

Lines changed: 39 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ concurrency:
3636
cancel-in-progress: true
3737

3838
jobs:
39+
lint:
40+
uses: ./.github/workflows/lint.yml
41+
3942
setup:
4043
runs-on: ubuntu-latest
4144
outputs:
@@ -65,22 +68,6 @@ jobs:
6568
docker_image: ${{ needs.setup.outputs.image }}
6669
rust_version: ${{ needs.setup.outputs.rust_version }}
6770

68-
lint:
69-
runs-on: ubuntu-latest
70-
steps:
71-
- uses: actions/checkout@v4
72-
73-
- name: Install Rust nightly
74-
uses: actions-rs/toolchain@v1
75-
with:
76-
toolchain: nightly
77-
profile: minimal
78-
components: rustfmt
79-
override: true
80-
81-
- name: Check formatting
82-
run: cargo +nightly fmt --all -- --check
83-
8471
build:
8572
needs:
8673
- setup

.github/workflows/coverage.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ concurrency:
3434
cancel-in-progress: true
3535

3636
jobs:
37+
lint:
38+
uses: ./.github/workflows/lint.yml
39+
3740
build-tests:
41+
needs: lint
3842
runs-on: ubuntu-latest
3943
env:
4044
CARGO_TARGET_DIR: target/llvm-cov-target

.github/workflows/integration-tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ concurrency:
3636
cancel-in-progress: true
3737

3838
jobs:
39+
lint:
40+
uses: ./.github/workflows/lint.yml
41+
3942
pop-fork-integration-tests:
43+
needs: lint
4044
strategy:
4145
fail-fast: true
4246
matrix:
@@ -186,6 +190,7 @@ jobs:
186190
pkill eth-rpc || true
187191
188192
contract-integration-tests:
193+
needs: lint
189194
strategy:
190195
fail-fast: true
191196
matrix:
@@ -278,6 +283,7 @@ jobs:
278283
--status-level all
279284
280285
chain-integration-tests:
286+
needs: lint
281287
strategy:
282288
fail-fast: true
283289
matrix:
@@ -371,6 +377,7 @@ jobs:
371377
--status-level all
372378
373379
pop-cli-integration-tests:
380+
needs: lint
374381
strategy:
375382
fail-fast: true
376383
matrix:

.github/workflows/lint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: lint
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_call:
8+
9+
jobs:
10+
fmt:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install Rust nightly
16+
uses: actions-rs/toolchain@v1
17+
with:
18+
toolchain: nightly
19+
profile: minimal
20+
components: rustfmt
21+
override: true
22+
23+
- name: Check formatting
24+
run: cargo +nightly fmt --all -- --check

crates/pop-cli/src/commands/call/chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ mod tests {
12531253

12541254
#[tokio::test]
12551255
async fn execute_flag_skips_submit_extrinsic_confirmation_from_call_data_works() -> Result<()> {
1256-
let node = TestNode::spawn().await?;
1256+
let node = SubstrateTestNode::spawn().await?;
12571257
let node_url = node.ws_url();
12581258
let client = set_up_client(node_url).await?;
12591259
let call_config = CallChainCommand {

0 commit comments

Comments
 (0)