-
Notifications
You must be signed in to change notification settings - Fork 13
130 lines (116 loc) · 5.26 KB
/
qemu.yaml
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
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Exotic architectures
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
jobs:
build_job:
runs-on: ubuntu-22.04
name: Build on ${{ matrix.target.arch }} / ${{ matrix.target.distro }} / ${{ matrix.config.name }} / date-polyfill ${{ matrix.target.date-polyfill}}
strategy:
matrix:
target:
- { arch: armv6, distro: alpine_latest, date-polyfill: 'ON' }
- { arch: armv7, distro: alpine_latest, date-polyfill: 'ON' }
- { arch: aarch64, distro: alpine_latest, date-polyfill: 'ON' }
- { arch: aarch64, distro: alpine_latest, date-polyfill: 'OFF' }
- { arch: riscv64, distro: alpine_latest, date-polyfill: 'ON' }
- { arch: s390x, distro: alpine_latest, date-polyfill: 'ON' }
- { arch: s390x, distro: alpine_latest, date-polyfill: 'OFF' }
- { arch: ppc64le, distro: alpine_latest, date-polyfill: 'ON' }
- { arch: ppc64le, distro: alpine_latest, date-polyfill: 'OFF' }
config:
- { name: Debug }
- { name: Release }
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get current date
id: date
uses: Kaven-Universe/github-action-current-date-time@v1
with:
format: "YYYY-MM-DD_HH-mm-ss-SSS"
- name: Cache builds
uses: actions/cache@v4
with:
key: ${{matrix.target.arch}}_${{matrix.target.distro}}_${{matrix.config.name}}_${{matrix.target.date-polyfill}}_ccache-${{ steps.date.outputs.time }}
path: ccache_cache
restore-keys: |
${{matrix.target.arch}}_${{matrix.target.distro}}_${{matrix.config.name}}_${{matrix.target.date-polyfill}}_ccache-
- uses: uraimo/run-on-arch-action@v2
name: Build artifact
id: build
with:
arch: ${{matrix.target.arch}}
distro: ${{matrix.target.distro}}
# Not required, but speeds up builds
githubToken: ${{github.token}}
setup: |
mkdir -p "${PWD}/artifacts"
mkdir -p "${PWD}/ccache_cache"
# Mount the artifacts directory as /artifacts
# Mount the ccache_cache directory as /ccache_cache
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts" --volume "${PWD}/ccache_cache:/ccache_cache"
# 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.target.distro}}" in
ubuntu*|bookworm)
apt-get update -q -y
apt-get install -q -y git cmake make doctest-dev libhowardhinnant-date-dev tzdata g++ ninja-build build-essential ccache
;;
fedora*)
dnf -y update
dnf -y groupinstall "Development Tools"
dnf -y install git which cmake make doctest-devel date date-devel tzdata gcc-c++ ninja-build ccache
;;
alpine*)
apk update
apk add git cmake make doctest-dev date-dev tzdata g++ samurai ccache linux-headers musl-dev
;;
esac
run: |
CCACHE_DIR=/ccache_cache
export CCACHE_DIR
export CCACHE_MAXSIZE=1G
CC=gcc
export CC
CXX=g++
export CXX
echo "Configuring sparrow"
cmake -G Ninja -Bbuild \
-DCMAKE_BUILD_TYPE:STRING=${{matrix.config.name}} \
-DUSE_DATE_POLYFILL=${{matrix.target.date-polyfill}} \
-DBUILD_TESTS=ON \
-DBUILD_EXAMPLES=ON \
-DUSE_LARGE_INT_PLACEHOLDERS=ON \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING
cd build
echo "Building sparrow library"
cmake --build . --config ${{matrix.config.name}} --target sparrow
echo "Building sparrow tests"
cmake --build . --config ${{matrix.config.name}} --target test_sparrow_lib
echo "Running sparrow examples"
cmake --build . --config ${{matrix.config.name}} --target run_examples
echo "Running sparrow tests"
cmake --build . --config ${{matrix.config.name}} --target run_tests_with_junit_report
ccache --show-stats
- name: Upload test results
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test_sparrow_lib_report_Linux_${{matrix.target.distro}}_${{matrix.target.arch}}_${{matrix.config.name}}_date-polyfill_${{matrix.target.date-polyfill}}
path: |
build/test/test_sparrow_lib_report_doctest.xml
build/test/test_sparrow_lib_report_catch2.xml
if-no-files-found: error