Skip to content

Commit bba4de2

Browse files
Merge #132
132: Update GitHub workflows r=almindor a=romancardenas With all the bors thing going on, I've been reading a bit about merge queues etc. and noticed that some of our workflows still use outdated/deprecated actions. This PR fixes this. Co-authored-by: Román Cárdenas <[email protected]>
2 parents b3e8290 + 8e1e690 commit bba4de2

File tree

6 files changed

+97
-100
lines changed

6 files changed

+97
-100
lines changed

.github/bors.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ block_labels = ["needs-decision"]
22
delete_merged_branches = true
33
required_approvals = 1
44
status = [
5-
"ci-linux (stable)",
6-
"ci-linux (1.59.0)",
7-
"build-other (macOS-latest)",
8-
"build-other (windows-latest)",
9-
"Rustfmt"
5+
"build-check",
6+
"clippy-check",
7+
"rustfmt",
108
]

.github/workflows/build.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
merge_group:
6+
7+
name: Build check
8+
9+
jobs:
10+
# We check that the crate builds and links for all the toolchains and targets.
11+
build-riscv:
12+
strategy:
13+
matrix:
14+
# All generated code should be running on stable now, MRSV is 1.59.0
15+
toolchain: [ stable, nightly, 1.59.0 ]
16+
target:
17+
- riscv32i-unknown-none-elf
18+
- riscv32imc-unknown-none-elf
19+
- riscv32imac-unknown-none-elf
20+
- riscv64imac-unknown-none-elf
21+
- riscv64gc-unknown-none-elf
22+
cargo_flags: [ "--no-default-features", "--all-features" ]
23+
include:
24+
# Nightly is only for reference and allowed to fail
25+
- toolchain: nightly
26+
experimental: true
27+
runs-on: ubuntu-latest
28+
continue-on-error: ${{ matrix.experimental || false }}
29+
steps:
30+
- uses: actions/checkout@v3
31+
- uses: dtolnay/rust-toolchain@master
32+
with:
33+
toolchain: ${{ matrix.toolchain }}
34+
targets: ${{ matrix.target }}
35+
- name: Build library
36+
run: cargo build --target ${{ matrix.target }} ${{ matrix.cargo_flags }}
37+
38+
# On MacOS, Ubuntu, and Windows, we at least make sure that the crate builds and links.
39+
build-others:
40+
strategy:
41+
matrix:
42+
os:
43+
- macos-latest
44+
- ubuntu-latest
45+
- windows-latest
46+
cargo_flags: [ "--no-default-features", "--all-features" ]
47+
runs-on: ${{ matrix.os }}
48+
steps:
49+
- uses: actions/checkout@v3
50+
- uses: dtolnay/rust-toolchain@stable
51+
- name: Build crate for host OS
52+
run: cargo build ${{ matrix.cargo_flags }}
53+
54+
# Job to check that all the builds succeeded
55+
build-check:
56+
needs:
57+
- build-riscv
58+
- build-others
59+
runs-on: ubuntu-latest
60+
if: always()
61+
steps:
62+
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

.github/workflows/ci.yaml

Lines changed: 0 additions & 67 deletions
This file was deleted.

.github/workflows/clippy.yaml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
1-
name: Clippy
2-
31
on:
42
push:
53
branches: [ staging, trying, master ]
64
pull_request:
7-
branches: [ master ]
5+
merge_group:
86

9-
defaults:
10-
run:
11-
shell: bash
7+
name: Lints compliance check
128

139
env:
1410
CLIPPY_PARAMS: -W clippy::all -W clippy::pedantic -W clippy::nursery -W clippy::cargo
1511

1612
jobs:
1713
clippy:
18-
name: Clippy
19-
runs-on: ubuntu-latest
2014
strategy:
2115
matrix:
16+
toolchain: [ stable, nightly ]
2217
cargo_flags:
2318
- "--no-default-features"
2419
- "--all-features"
20+
include:
21+
# Nightly is only for reference and allowed to fail
22+
- toolchain: nightly
23+
experimental: true
24+
runs-on: ubuntu-latest
25+
continue-on-error: ${{ matrix.experimental || false }}
2526
steps:
26-
- name: Checkout source code
27-
uses: actions/checkout@v3
28-
29-
- name: Install Rust toolchain
30-
uses: dtolnay/rust-toolchain@stable
27+
- uses: actions/checkout@v3
28+
- uses: dtolnay/rust-toolchain@master
3129
with:
32-
toolchain: stable
30+
toolchain: ${{ matrix.toolchain }}
3331
components: clippy
34-
3532
- name: Run clippy
3633
run: cargo clippy --all ${{ matrix.cargo_flags }} -- -D warnings
34+
35+
# Job to check that all the lint checks succeeded
36+
clippy-check:
37+
needs:
38+
- clippy
39+
runs-on: ubuntu-latest
40+
if: always()
41+
steps:
42+
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

.github/workflows/rustfmt.yaml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
1-
21
on:
32
push:
43
branches: [ staging, trying, master ]
54
pull_request:
5+
merge_group:
66

77
name: Code formatting check
88

99
jobs:
10-
fmt:
11-
name: Rustfmt
12-
runs-on: ubuntu-20.04
10+
rustfmt:
11+
runs-on: ubuntu-latest
1312
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions-rs/toolchain@v1
13+
- uses: actions/checkout@v3
14+
- uses: dtolnay/rust-toolchain@stable
1615
with:
17-
profile: minimal
18-
toolchain: stable
19-
override: true
2016
components: rustfmt
21-
- uses: actions-rs/cargo@v1
22-
with:
23-
command: fmt
24-
args: --all -- --check
17+
- name: Run Rustfmt
18+
run: cargo fmt --all -- --check --verbose

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1313
- Add `asm::fence()`, a wrapper for implementing a `fence` instruction
1414
- Add `asm::fence_i()`, a wrapper for implementing a `fence.i` instruction
1515

16+
### Changed
17+
18+
- CI actions updated. They now use `checkout@v3` and `dtolnay/rust-toolchain`.
19+
1620
## [v0.10.1] - 2023-01-18
1721

1822
### Fixed

0 commit comments

Comments
 (0)