-
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (73 loc) · 2.27 KB
/
ci.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: build
on:
push:
branches:
- main
paths:
- 'Cargo.lock'
- 'Cargo.toml'
- 'src/**'
pull_request:
branches:
- main
paths:
- 'Cargo.lock'
- 'Cargo.toml'
- 'src/**'
jobs:
build-and-test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
include:
- os: ubuntu-latest
name: Linux Binary 64-Bit
target: x86_64-unknown-linux-musl
- os: macos-latest
name: MacOS Binary 64-Bit
target: x86_64-apple-darwin
target2: aarch64-apple-darwin
- os: windows-latest
name: Windows Binary 64-Bit
target: x86_64-pc-windows-msvc
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Add rustup default target
run: rustup target add ${{ matrix.target }}
- name: Add rustup Apple ARM64 target
if: ${{ matrix.os == 'macos-latest' }}
run: rustup target add ${{ matrix.target2 }}
- name: Install apt packages
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get install musl-tools libssl-dev
# needed to fix file corruption of cache
# https://github.com/actions/cache/issues/403
- name: Install GNU tar
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install gnu-tar
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
- name: Store or retrieve cargo caches
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build default target in debug mode
run: cargo build --target ${{ matrix.target }} --locked
- name: Build Apple ARM64 target in debug mode
if: ${{ matrix.os == 'macos-latest' }}
run: cargo build --target ${{ matrix.target2 }} --locked
- name: Test default target in debug mode
run: cargo test --target ${{ matrix.target }}