Skip to content

Commit 75f5727

Browse files
committed
GitHub Actions: Modernize Linux x64 workflow
1 parent 84bda23 commit 75f5727

File tree

3 files changed

+84
-79
lines changed

3 files changed

+84
-79
lines changed

.github/workflows/linux-aarch64.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@ jobs:
2121

2222
- name: Install Rust
2323
uses: dtolnay/[email protected]
24-
with:
25-
targets: aarch64-apple-darwin
2624

2725
- name: Rust cache
2826
uses: swatinem/rust-cache@v2
2927

3028
- name: cargo build
31-
run:
32-
cargo build --target aarch64-unknown-linux-gnu
29+
run: cargo build

.github/workflows/linux-x86_64.yml

Lines changed: 82 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -12,119 +12,128 @@ name: Linux x86_64
1212
jobs:
1313
check:
1414
name: Check
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-22.04
1616
steps:
17-
- uses: actions/checkout@v2
17+
- name: Checkout
18+
uses: actions/checkout@v4
1819
with:
1920
submodules: recursive
20-
- uses: actions-rs/toolchain@v1
21-
with:
22-
profile: minimal
23-
toolchain: stable
24-
override: true
21+
22+
- name: Install Rust
23+
uses: dtolnay/[email protected]
24+
25+
- name: Rust cache
26+
uses: swatinem/rust-cache@v2
27+
2528
- name: cargo check
26-
uses: actions-rs/cargo@v1
27-
with:
28-
command: check
29+
run: cargo check
2930

3031
generate:
3132
name: Generate low-level API
32-
runs-on: ubuntu-latest
33+
runs-on: ubuntu-22.04
3334
steps:
34-
- uses: actions/checkout@v2
35-
with:
36-
submodules: recursive
3735
- name: Set up dependencies
3836
run: |
3937
sudo apt-get update
4038
sudo apt-get install clang
41-
- uses: actions-rs/toolchain@v1
39+
40+
- name: Checkout
41+
uses: actions/checkout@v4
4242
with:
43-
profile: minimal
44-
toolchain: stable
45-
override: true
43+
submodules: recursive
44+
45+
- name: Install Rust
46+
uses: dtolnay/[email protected]
47+
48+
- name: Rust cache
49+
uses: swatinem/rust-cache@v2
50+
4651
- name: cargo build
47-
uses: actions-rs/cargo@v1
48-
with:
49-
command: build
50-
args: --manifest-path main/low/Cargo.toml --features generate
52+
run: cargo build --manifest-path main/low/Cargo.toml --features generate
5153

5254
test:
53-
name: Test Suite
54-
runs-on: ubuntu-latest
55+
name: Run tests
56+
runs-on: ubuntu-22.04
5557
steps:
56-
- uses: actions/checkout@v2
58+
- name: Checkout
59+
uses: actions/checkout@v4
5760
with:
5861
submodules: recursive
59-
- uses: actions-rs/toolchain@v1
60-
with:
61-
profile: minimal
62-
toolchain: stable
63-
override: true
62+
63+
- name: Install Rust
64+
uses: dtolnay/[email protected]
65+
66+
- name: Rust cache
67+
uses: swatinem/rust-cache@v2
68+
6469
- name: cargo build
65-
uses: actions-rs/cargo@v1
66-
with:
67-
command: build
68-
- uses: actions/upload-artifact@v4
70+
run: cargo build
71+
72+
- name: Upload test plug-ins
73+
uses: actions/upload-artifact@v4
6974
with:
7075
name: test-plug-ins
7176
path: target/debug/*.so
77+
7278
- name: cargo test
73-
uses: actions-rs/cargo@v1
74-
with:
75-
command: test
76-
args: -- --nocapture
79+
run: cargo test -- --nocapture
7780

7881
fmt:
79-
name: Rustfmt
80-
runs-on: ubuntu-latest
82+
name: Check formatting
83+
runs-on: ubuntu-22.04
8184
steps:
82-
- uses: actions/checkout@v2
83-
- uses: actions-rs/toolchain@v1
85+
- name: Checkout
86+
uses: actions/checkout@v4
8487
with:
85-
profile: minimal
86-
toolchain: stable
87-
override: true
88-
- run: rustup component add rustfmt
89-
- name: cargo fmt
90-
uses: actions-rs/cargo@v1
88+
submodules: recursive
89+
90+
- name: Install Rust
91+
uses: dtolnay/[email protected]
9192
with:
92-
command: fmt
93-
args: --all -- --check
93+
components: rustfmt
94+
95+
- name: Rust cache
96+
uses: swatinem/rust-cache@v2
97+
98+
- name: cargo fmt
99+
run: cargo fmt --all -- --check
94100

95101
doc:
96-
name: Doc
97-
runs-on: ubuntu-latest
102+
name: Check docs
103+
runs-on: ubuntu-22.04
98104
steps:
99-
- uses: actions/checkout@v2
105+
- name: Checkout
106+
uses: actions/checkout@v4
100107
with:
101108
submodules: recursive
102-
- uses: actions-rs/toolchain@v1
109+
110+
- name: Install Rust
111+
uses: dtolnay/[email protected]
103112
with:
104-
profile: minimal
105-
toolchain: stable
106-
override: true
107-
- run: rustup component add rust-docs
113+
components: rust-docs
114+
115+
- name: Rust cache
116+
uses: swatinem/rust-cache@v2
117+
108118
- name: cargo doc
109-
uses: actions-rs/cargo@v1
110-
with:
111-
command: doc
119+
run: cargo doc
112120

113121
clippy:
114-
name: Clippy
115-
runs-on: ubuntu-latest
122+
name: Check clippy lints
123+
runs-on: ubuntu-22.04
116124
steps:
117-
- uses: actions/checkout@v2
125+
- name: Checkout
126+
uses: actions/checkout@v4
118127
with:
119128
submodules: recursive
120-
- uses: actions-rs/toolchain@v1
129+
130+
- name: Install Rust
131+
uses: dtolnay/[email protected]
121132
with:
122-
profile: minimal
123-
toolchain: stable
124-
override: true
125-
- run: rustup component add clippy
133+
components: clippy
134+
135+
- name: Rust cache
136+
uses: swatinem/rust-cache@v2
137+
126138
- name: cargo clippy
127-
uses: actions-rs/cargo@v1
128-
with:
129-
command: clippy
130-
args: -- -D warnings
139+
run: cargo clippy -- -D warnings

.github/workflows/macos-aarch64.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ jobs:
3030
uses: swatinem/rust-cache@v2
3131

3232
- name: cargo build
33-
run:
34-
cargo build --target aarch64-apple-darwin
33+
run: cargo build --target aarch64-apple-darwin

0 commit comments

Comments
 (0)