Skip to content

Commit 44b7d4a

Browse files
authored
Merge pull request #14 from rust-osdev/bishop-update-ci
ci: Bring in various improvements from uefi-rs
2 parents ad816f4 + ae15f41 commit 44b7d4a

File tree

1 file changed

+22
-34
lines changed

1 file changed

+22
-34
lines changed

.github/workflows/rust.yml

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
name: Rust
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: '0 0 * * 4'
412

513
jobs:
614
check:
715
name: Check
816
runs-on: ubuntu-latest
917
steps:
1018
- name: Checkout sources
11-
uses: actions/checkout@v1
19+
uses: actions/checkout@v3
1220

13-
- name: Install stable toolchain
14-
uses: actions-rs/toolchain@v1
15-
with:
16-
profile: minimal
17-
toolchain: stable
18-
override: true
21+
- uses: Swatinem/rust-cache@v2
1922

2023
- name: Run cargo check
2124
uses: actions-rs/cargo@v1
@@ -27,43 +30,28 @@ jobs:
2730
runs-on: ubuntu-latest
2831
steps:
2932
- name: Checkout sources
30-
uses: actions/checkout@v1
33+
uses: actions/checkout@v3
3134

32-
- name: Install stable toolchain
33-
uses: actions-rs/toolchain@v1
34-
with:
35-
profile: minimal
36-
toolchain: stable
37-
override: true
35+
- uses: Swatinem/rust-cache@v2
3836

3937
- name: Run cargo test
40-
uses: actions-rs/cargo@v1
41-
with:
42-
command: test
38+
run: cargo test
4339

4440
lints:
4541
name: Lints
4642
runs-on: ubuntu-latest
4743
steps:
4844
- name: Checkout sources
49-
uses: actions/checkout@v1
45+
uses: actions/checkout@v3
5046

51-
- name: Install stable toolchain
52-
uses: actions-rs/toolchain@v1
53-
with:
54-
profile: minimal
55-
toolchain: stable
56-
override: true
57-
components: rustfmt, clippy
47+
- uses: Swatinem/rust-cache@v2
5848

5949
- name: Run cargo fmt
60-
uses: actions-rs/cargo@v1
61-
with:
62-
command: fmt
63-
args: --all -- --check
50+
run: |
51+
rustup component add rustfmt
52+
cargo fmt --all -- --check
6453
6554
- name: Run cargo clippy
66-
uses: actions-rs/cargo@v1
67-
with:
68-
command: clippy
69-
args: -- -D warnings
55+
run: |
56+
rustup component add clippy
57+
cargo clippy -- -D warnings

0 commit comments

Comments
 (0)