-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (62 loc) · 1.61 KB
/
build_and_test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Rust
on:
push:
tags:
- "v*"
branches:
- master
pull_request:
branches:
- master
release:
types:
- created
workflow_dispatch:
jobs:
build:
name: Build for multiple platforms
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
package_name: linux-x64
- os: windows-latest
package_name: windows-x64
# - os: windows-latest
# package_name: windows-arm64
# target: aarch64-pc-windows-msvc
- os: macos-latest
package_name: macos-aarch64
- os: macos-13
package_name: macos-x64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
target: ${{ matrix.target }}
- name: Build
run: |
if [ "${{ matrix.target }}" != "" ]; then
cargo build --release --target ${{ matrix.target }}
else
cargo build --release
fi
shell: bash
- name: Test
run: |
if [ "${{ matrix.target }}" != "" ]; then
cargo test --no-fail-fast --lib --target ${{ matrix.target }} 2>&1 | tee result.txt
else
cargo test --no-fail-fast --lib 2>&1 | tee result.txt
fi
shell: bash
continue-on-error: true
- name: Format test results
uses: hahihula/rust-test-results-formatter@v1
with:
results-file: "result.txt"