forked from unlimitedbacon/stl-thumb
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (74 loc) · 2.44 KB
/
build-ci.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
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build and Test
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-buildtest-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install libosmesa6-dev
- name: Build
run: cargo build --verbose
- name: Run tests
run: RUST_BACKTRACE=1 cargo test --verbose
package:
needs: [build]
name: Package
runs-on: ubuntu-18.04
strategy:
matrix:
target: [x86_64-unknown-linux-gnu, armv7-unknown-linux-gnueabihf, aarch64-unknown-linux-gnu]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install packages
# This is all BS to get random dependencies to cross compile and I hate it
run: |
sudo cp .github/workflows/sources.list /etc/apt/sources.list
sudo dpkg --add-architecture arm64
sudo dpkg --add-architecture armhf
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu g++-arm-linux-gnueabihf g++-aarch64-linux-gnu libc-dev-armhf-cross libc-dev-arm64-cross libfreetype6-dev:arm64 libfreetype6-dev:armhf libfontconfig-dev:arm64 libfontconfig-dev:armhf
- name: Prep build environment
run: |
if [ ${{ matrix.target }} == "armv7-unknown-linux-gnueabihf" ];
then
export PKG_CONFIG_SYSROOT_DIR=/usr/arm-linux-gnueabihf
elif [ ${{ matrix.target }} == "aarch64-unknown-linux-gnu" ];
then
export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu
fi
rustup target add ${{ matrix.target }}
cargo install cargo-deb --force
- name: Package
run: cargo deb --target ${{ matrix.target }}
- uses: actions/upload-artifact@v3
with:
name: deb-${{ matrix.target }}
path: target/${{ matrix.target }}/debian/*.deb