-
Notifications
You must be signed in to change notification settings - Fork 4
60 lines (54 loc) · 1.71 KB
/
ci.yml
File metadata and controls
60 lines (54 loc) · 1.71 KB
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
name: CI
on:
- pull_request
jobs:
build:
name: Build
strategy:
matrix:
include:
- os: ubuntu-22.04
arch: amd64
- os: ubuntu-22.04
arch: arm64
- os: ubuntu-24.04
arch: amd64
- os: ubuntu-24.04
arch: arm64
- os: windows-2022
arch: x64
- os: macos-13
arch: x64
- os: macos-14
arch: arm64
runs-on: ${{ (matrix.arch == 'arm64' && matrix.os == 'macos-14') && 'macos-14' || matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v1
- name: Install Rust toolchain
run: |
rustup update
rustup show
- name: install Just
uses: extractions/setup-just@v1
with:
just-version: 1.14.0
- name: Setup cross-compilation for ARM64 Linux
if: ${{ startsWith(matrix.os, 'ubuntu-') && matrix.arch == 'arm64' }}
run: |
rustup target add aarch64-unknown-linux-gnu
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu pkg-config
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
- name: Build and Test (ARM64 Linux Cross-Compilation)
if: ${{ startsWith(matrix.os, 'ubuntu-') && matrix.arch == 'arm64' }}
run: |
just fmt
git diff --exit-code
just check
cargo build --locked --target aarch64-unknown-linux-gnu
just test
- name: Build and Test (Standard)
if: ${{ !(startsWith(matrix.os, 'ubuntu-') && matrix.arch == 'arm64') }}
run: just ci