-
Notifications
You must be signed in to change notification settings - Fork 17
85 lines (85 loc) · 2.68 KB
/
build-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
name: Build Rust Crate
on:
push:
branches:
- main
pull_request:
branches:
- "*"
jobs:
build:
name: Build Crate (${{ matrix.platform }})
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform: Linux
packages:
- gcc-aarch64-linux-gnu
test-targets:
- x86_64-unknown-linux-gnu
targets:
- aarch64-unknown-linux-gnu
- os: macos-13
platform: macOS (Intel)
xcode: /Applications/Xcode_15.2.app
test-targets:
- x86_64-apple-darwin
targets:
- x86_64-apple-ios
- os: macos-14
platform: macOS
xcode: /Applications/Xcode_16.0.app
test-targets:
- aarch64-apple-darwin
targets:
- aarch64-apple-ios
- aarch64-apple-ios-sim
- os: windows-2022
platform: Windows
test-targets:
- x86_64-pc-windows-msvc
targets:
- aarch64-pc-windows-msvc
runs-on: ${{ matrix.os }}
env:
DEVELOPER_DIR: ${{ matrix.xcode }}/Contents/Developer
CARGO_INCREMENTAL: 0
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
RUST_BACKTRACE: short
PROTOC_VERSION: 3.25.1
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
submodules: recursive
- name: Install Packages
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y ${{ join(matrix.packages, ' ') }}
- name: Install Windows Deps
if: matrix.os == 'windows-2022'
shell: bash
run: echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\Llvm\x64\bin" >> $GITHUB_PATH
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
targets: ${{ join(matrix.targets, ', ') }}
- name: Install protoc
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
- name: Build
shell: bash
run: cargo build --verbose --workspace --all-features --target ${{ join(matrix.targets, ' --target ') }} --target ${{ join(matrix.test-targets, ' --target ') }}
- name: Test
shell: bash
run: cargo test --verbose --workspace --all-features --target ${{ join(matrix.test-targets, ' --target ') }}