-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (80 loc) · 3 KB
/
rust.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
90
91
92
93
94
95
96
97
98
99
100
101
name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
SQLX_OFFLINE: "true"
jobs:
unit-tests-darwin:
runs-on: macos-latest
strategy:
matrix:
arch: [x86_64, aarch64]
steps:
- name: Ensure musl installed
run: rustup target add ${{ matrix.arch }}-apple-darwin
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- name: Run unit tests
run: cargo test --target ${{ matrix.arch }}-apple-darwin
unit-tests-linux:
runs-on: ubuntu-latest
container:
image: rust:1.78-bookworm
strategy:
matrix:
arch: [x86_64, aarch64]
steps:
- name: Ensure toolchain installed
run: |
dpkg --add-architecture arm64 \
&& apt-get update \
&& apt-get install -y musl-dev:arm64 musl-dev musl-tools musl llvm clang qemu-user \
&& rustup target add ${{ matrix.arch }}-unknown-linux-musl
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- name: Run unit tests
run: cargo test --target ${{ matrix.arch }}-unknown-linux-musl
build-release-darwin:
runs-on: macos-latest
strategy:
matrix:
arch: [x86_64, aarch64]
if: github.ref == 'refs/heads/main'
steps:
- name: Ensure toolchain installed
run: rustup target add ${{ matrix.arch }}-apple-darwin
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Build final release binary
run: cargo build --release --target ${{ matrix.arch }}-apple-darwin --verbose
- name: Upload artifact
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
with:
name: iam-assumer-darwin-${{ matrix.arch }}
path: target/${{ matrix.arch }}-apple-darwin/release/iam-assumer
build-release-linux:
runs-on: ubuntu-latest
container:
image: rust:1.78-bookworm
strategy:
matrix:
arch: [x86_64, aarch64]
if: github.ref == 'refs/heads/main'
steps:
- name: Ensure toolchain installed
run: |
dpkg --add-architecture arm64 \
&& apt-get update \
&& apt-get install -y musl-dev:arm64 musl-dev musl-tools musl llvm clang qemu-user \
&& rustup target add ${{ matrix.arch }}-unknown-linux-musl
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Build final release binary
run: cargo build --release --target ${{ matrix.arch }}-unknown-linux-musl --verbose
- name: Upload artifact
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
with:
name: iam-assumer-linux-${{ matrix.arch }}
path: target/${{ matrix.arch }}-unknown-linux-musl/release/iam-assumer