Skip to content

Commit 15e72bc

Browse files
committed
Move cargo fmt check to end of CI workflow
1 parent 9a05ed8 commit 15e72bc

File tree

2 files changed

+34
-26
lines changed

2 files changed

+34
-26
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,56 @@ env:
99
CARGO_REGISTRIES_MY_REGISTRY_INDEX: https://github.com/rust-lang/crates.io-index
1010

1111
jobs:
12+
# 1
1213
check:
13-
runs-on: ubuntu-20.04
14+
name: Rust project check
15+
runs-on: ubuntu-latest
1416
steps:
1517
- uses: actions/checkout@v2
16-
- uses: actions-rs/toolchain@v1
18+
- name: Install latest nightly
19+
uses: actions-rs/toolchain@v1
1720
with:
18-
profile: minimal
1921
toolchain: nightly
22+
override: true
2023
components: rustfmt, clippy
21-
- name: Check code format
24+
25+
# `cargo check` command here will use installed `nightly`
26+
# as it is set as an "override" for current directory
27+
28+
- name: Run cargo check
2229
uses: actions-rs/cargo@v1
2330
with:
24-
command: fmt
25-
args: --all -- --check
31+
command: check
2632

2733

28-
build:
29-
runs-on: ubuntu-20.04
30-
steps:
31-
- uses: actions/checkout@v2
32-
- uses: actions-rs/toolchain@v1
33-
with:
34-
profile: minimal
35-
toolchain: nightly-2023-04-07
36-
- uses: actions/checkout@v2
37-
- name: Build
34+
- name: Run cargo build
3835
uses: actions-rs/cargo@v1
3936
with:
4037
command: build
4138

42-
test:
43-
runs-on: ubuntu-20.04
39+
40+
- name: Run cargo test
41+
uses: actions-rs/cargo@v1
42+
with:
43+
command: test
44+
# 2
45+
fmt:
46+
name: Rust fmt
47+
runs-on: ubuntu-latest
4448
steps:
4549
- uses: actions/checkout@v2
46-
- uses: actions-rs/toolchain@v1
50+
- name: Install latest nightly
51+
uses: actions-rs/toolchain@v1
4752
with:
48-
profile: minimal
49-
toolchain: nightly-2023-04-07
50-
- uses: actions/checkout@v2
51-
- name: Test
53+
toolchain: nightly
54+
override: true
55+
components: rustfmt, clippy
56+
57+
# `cargo check` command here will use installed `nightly`
58+
# as it is set as an "override" for current directory
59+
60+
- name: Run cargo fmt
5261
uses: actions-rs/cargo@v1
5362
with:
54-
command: test
55-
args: --release --no-fail-fast
63+
command: fmt
64+
args: -- --check

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(error_generic_member_access)]
2-
#![feature(provide_any)]
32
#![allow(unused_doc_comments)]
43
#![feature(result_flattening)]
54
#![feature(generators)]

0 commit comments

Comments
 (0)