-
Notifications
You must be signed in to change notification settings - Fork 29
118 lines (110 loc) · 3.42 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]
build-mac:
runs-on: macos-latest
needs: [lint]
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
build:
runs-on: ${{ matrix.os }}
needs: [lint]
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: sudo apt install libunwind-dev
if: runner.os == 'Linux'
- name: Build
run: cargo build --verbose --examples --features unwind
- name: Run tests
run: cargo test --verbose --features unwind
build-linux-cross:
runs-on: ubuntu-latest
needs: [lint]
strategy:
matrix:
target:
[
i686-unknown-linux-musl,
armv7-unknown-linux-musleabihf,
aarch64-unknown-linux-musl,
x86_64-unknown-linux-musl,
]
container:
image: ghcr.io/benfred/rust-musl-cross:${{ matrix.target }}
env:
RUSTUP_HOME: /root/.rustup
CARGO_HOME: /root/.cargo
steps:
- uses: actions/checkout@v2
- name: Build (unwind)
run: cargo build --verbose --features unwind --examples
if: matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'armv7-unknown-linux-musleabihf'
- name: Build (no-unwind)
run: cargo build --verbose --examples
if: matrix.target == 'i686-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'
# unittests don't compile here - with some duplicate symbol errors.
# - name: Run tests
# run: cargo test --verbose --features unwind
# if: matrix.target == 'x86_64-unknown-linux-musl'
build-freebsd:
runs-on: ubuntu-22.04
needs: [lint]
timeout-minutes: 30
strategy:
matrix:
box:
- freebsd-14
steps:
- uses: actions/checkout@v3
- name: Cache Vagrant box
uses: actions/[email protected]
with:
path: .vagrant.d
key: ${{ matrix.box }}-vagrant-boxes-20231115-${{ hashFiles('ci/Vagrantfile') }}
restore-keys: |
${{ matrix.box }}-vagrant-boxes-20231115-
- name: Cache Cargo and build artifacts
uses: actions/[email protected]
with:
path: build-artifacts.tar
key: ${{ matrix.box }}-cargo-20231115-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.box }}-cargo-20231115-
- name: Display CPU info
run: lscpu
- name: Install VM tools
run: |
sudo apt-get update -qq
sudo apt-get install -qq -o=Dpkg::Use-Pty=0 moreutils
sudo chronic apt-get install -qq -o=Dpkg::Use-Pty=0 vagrant virtualbox qemu libvirt-daemon-system
- name: Set up VM
shell: sudo bash {0}
run: |
vagrant plugin install vagrant-libvirt
vagrant plugin install vagrant-scp
ln -sf ci/Vagrantfile Vagrantfile
vagrant status
vagrant up --no-tty --provider libvirt ${{ matrix.box }}
- name: Build and test
shell: sudo bash {0}
run: vagrant ssh ${{ matrix.box }} -- bash /vagrant/ci/test_freebsd.sh