1
1
name : Rust
2
2
3
3
on :
4
- push :
5
- branches : [ "dev" ]
6
4
pull_request :
7
- branches : [ "dev" ]
5
+ branches : ["dev"]
6
+ push :
7
+ branches : ["dev"]
8
+ workflow_dispatch :
8
9
9
10
env :
10
11
CARGO_TERM_COLOR : always
11
12
12
13
jobs :
13
14
build :
14
- runs-on : ubuntu-latest
15
+ runs-on : ${{ matrix.os }}
16
+ strategy :
17
+ matrix :
18
+ include :
19
+ - os : macos-14
20
+ target : aarch64-apple-darwin
21
+ - os : ubuntu-latest
22
+ target : x86_64-unknown-linux-gnu
23
+ - os : windows-latest
24
+ target : x86_64-pc-windows-msvc
15
25
16
26
steps :
17
- - uses : actions/checkout@v4
18
-
19
- - name : Install Rust nightly
20
- uses : actions-rs/toolchain@v1
21
- with :
22
- toolchain : nightly
23
- override : true
27
+ - name : Checkout repository
28
+ uses : actions/checkout@v4
24
29
25
30
- name : Cache dependencies
26
- uses : actions/cache@v3
31
+ uses : swatinem/rust-cache@v2
32
+
33
+ - name : Install Rust nightly
34
+ uses : dtolnay/rust-toolchain@nightly
27
35
with :
28
- path : |
29
- ~/.cargo/bin/
30
- ~/.cargo/registry/index/
31
- ~/.cargo/registry/cache/
32
- ~/.cargo/git/db/
33
- target/
34
- key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
35
- restore-keys : |
36
- ${{ runner.os }}-cargo-
36
+ targets : ${{ matrix.target }}
37
37
38
38
- name : Build
39
- uses : actions-rs /cargo@v1
39
+ uses :
ClementTsang /cargo[email protected]
40
40
with :
41
+ args : --release --target ${{ matrix.target }} --verbose
41
42
command : build
42
- args : --release --verbose
43
43
44
44
- name : Run tests
45
- uses : actions-rs /cargo@v1
45
+ uses :
ClementTsang /cargo[email protected]
46
46
with :
47
+ args : --target ${{ matrix.target }} --verbose
47
48
command : test
48
- args : --verbose
49
49
50
50
- name : Upload executable
51
51
uses : actions/upload-artifact@v4
52
52
with :
53
- name : ferrumc
54
- path : target/release/ferrumc
53
+ name : ferrumc-${{ matrix.os }}
54
+ path : target/${{ matrix.target }}/ release/ferrumc*
55
55
56
56
# Uncomment the following block if you want to send a message to Discord:
57
57
# - name: Send message to Discord
61
61
# with:
62
62
# args: 'A new commit has been pushed!
63
63
#
64
- # {{ EVENT_PAYLOAD.head_commit.url }}'
64
+ # {{ EVENT_PAYLOAD.head_commit.url }}'
0 commit comments