-
Notifications
You must be signed in to change notification settings - Fork 366
87 lines (85 loc) · 2.52 KB
/
build.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
name: Setup, Build & Test
on:
workflow_call:
inputs:
os:
required: true
type: string
platform:
required: true
type: string
arch:
required: true
type: string
jobs:
build:
runs-on: ${{ inputs.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: yarn
node-version: lts/*
- name: Install Linux dependencies
if: inputs.platform == 'linux'
run: |
sudo apt-get -y update
sudo apt-get -y install make nodejs
sudo snap install zig --classic --beta
- name: Install MacOS dependencies
if: inputs.platform == 'darwin'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install zig make
- name: Install Windows dependencies
if: inputs.platform == 'windows'
shell: pwsh
run: |
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
scoop install make zig
- name: Install JavaScript dependencies
run: |
corepack enable
yarn
- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
- name: Cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Run tests
if: inputs.arch != 'aarch64' || inputs.platform != 'linux'
run: |
make test-ci
- name: Run tests
if: inputs.arch == 'aarch64' && inputs.platform == 'linux'
env:
_VIRTUAL_ENV: qemu-aarch64
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUNNER: qemu-aarch64
run: |
sudo apt-get install -y \
libc6-arm64-cross \
libc6-dev-arm64-cross \
crossbuild-essential-arm64 \
qemu-system-arm \
qemu-efi-aarch64 \
qemu-utils \
qemu-user
make CURRENT_TARGET=aarch64-unknown-linux-gnu test-ci