This repository has been archived by the owner on Feb 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
113 lines (96 loc) · 3.29 KB
/
run-on-arch.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
on: [push, pull_request]
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: sreimers/[email protected]
with:
name: re
repo: https://github.com/baresip/re
secret: ${{ secrets.GITHUB_TOKEN }}
- uses: sreimers/[email protected]
with:
name: rem
repo: https://github.com/baresip/rem
secret: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: prepare
path: |
re
rem
build_job:
# The host should always be linux
runs-on: ubuntu-20.04
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}
needs: prepare
# Run steps on a matrix of 3 arch/distro combinations
strategy:
matrix:
include:
- arch: armv7
distro: alpine_latest
- arch: aarch64
distro: bullseye
- arch: s390x
distro: fedora_latest
steps:
- uses: actions/checkout@v3
- name: Download re/rem
uses: actions/download-artifact@v3
with:
name: prepare
- uses: uraimo/run-on-arch-action@v2
name: Build artifact
id: build
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
# Not required, but speeds up builds
githubToken: ${{ github.token }}
env: |
CMAKE_GENERATOR: Ninja
# Create an artifacts directory
setup: |
mkdir -p "${PWD}/artifacts"
# The shell to run commands with in the container
shell: /bin/sh
# Install some dependencies in the container. This speeds up builds if
# you are also using githubToken. Any dependencies installed here will
# be part of the container image that gets cached, so subsequent
# builds don't have to re-install them. The image layer is cached
# publicly in your project's package repository, so it is vital that
# no secrets are present in the container state or logs.
install: |
case "${{ matrix.distro }}" in
ubuntu*|jessie|stretch|buster|bullseye)
apt-get update -q -y
apt-get install -q -y cmake gcc git make libssl-dev ninja-build
;;
fedora*)
dnf -y update
dnf -y install cmake gcc git make openssl-devel ninja-build
;;
alpine*)
apk update
apk add cmake gcc git linux-headers make musl-dev openssl-dev ninja
;;
esac
# Produce a binary artifact and place it in the mounted volume
run: |
for p in re; do
cmake -S $p -B $p/build -DCMAKE_C_FLAGS="-Werror" -DCMAKE_BUILD_TYPE=Debug
cmake --build $p/build -j
done
for p in re; do
mv $p ../.
done
cmake -B build -DCMAKE_C_FLAGS="-Werror" -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j
./build/retest -v -r
- name: Show the artifact
# Items placed in /artifacts in the container will be in
# ${PWD}/artifacts on the host.
run: |
ls -al "${PWD}/artifacts"