1
- name : Cross-platform Build
1
+ name : Cross-platform Build and Test
2
2
3
3
on :
4
4
push :
25
25
26
26
steps :
27
27
- uses : actions/checkout@v3
28
-
28
+
29
29
- name : Install Rust
30
30
uses : actions-rs/toolchain@v1
31
31
with :
@@ -52,11 +52,52 @@ jobs:
52
52
run : sudo apt-get install gcc-mingw-w64-x86-64 -y
53
53
54
54
- name : Build with cargo-zigbuild
55
- # if: ${{ !endsWith(matrix.target, 'windows-gnu') && !endsWith(matrix.target, 'windows-msvc') }}
56
55
run : cargo zigbuild --target ${{ matrix.target }} --release
57
56
58
57
- name : Upload artifacts
59
58
uses : actions/upload-artifact@v3
60
59
with :
61
60
name : ${{ matrix.target }}
62
- path : target/${{ matrix.target }}/release/*
61
+ path : target/${{ matrix.target }}/release/*
62
+
63
+ test :
64
+ name : Test on ${{ matrix.os }}
65
+ needs : build
66
+ strategy :
67
+ matrix :
68
+ include :
69
+ - os : ubuntu-latest
70
+ target : x86_64-unknown-linux-gnu
71
+ - os : linux-arm64
72
+ target : aarch64-unknown-linux-gnu
73
+ - os : macos-latest
74
+ target : x86_64-apple-darwin
75
+ - os : macos-latest
76
+ target : aarch64-apple-darwin
77
+ - os : windows-latest
78
+ target : x86_64-pc-windows-gnu
79
+
80
+ runs-on : ${{ matrix.os }}
81
+
82
+ steps :
83
+ - uses : actions/checkout@v3
84
+
85
+ - name : Install Rust
86
+ uses : actions-rs/toolchain@v1
87
+ with :
88
+ toolchain : stable
89
+ target : ${{ matrix.target }}
90
+ override : true
91
+
92
+ - name : Download artifacts
93
+ uses : actions/download-artifact@v3
94
+ with :
95
+ name : ${{ matrix.target }}
96
+ path : target/${{ matrix.target }}/release
97
+
98
+ - name : Make binaries executable
99
+ if : runner.os != 'Windows'
100
+ run : chmod +x target/${{ matrix.target }}/release/*
101
+
102
+ - name : Run tests
103
+ run : cargo test --target ${{ matrix.target }}
0 commit comments