forked from moritz-wundke/Boost-for-Android
-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (71 loc) · 2.59 KB
/
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
name: CI
on: [pull_request]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
build:
strategy:
matrix:
boost_version: [1.74.0,1.78.0]
abi: [armeabi-v7a,arm64-v8a,x86,x86_64]
os: [ubuntu-latest,macos-latest]
include:
# includes a new variable of 'variation' for each host os
- os: ubuntu-latest
variation: linux
- os: macos-latest
variation: mac
# specify ndk version for each boost version
- boost_version: 1.78.0
ndk_version: 23.1.7779620
- boost_version: 1.74.0
ndk_version: 21.4.7075529
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Sources
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Android Environment
uses: android-actions/setup-android@v2
- name: Install Android NDK
run: sdkmanager --install "ndk;${{ matrix.ndk_version }}" --channel=1
- name: Setup Environment Variables
run: |
set -x
export NDK_ROOT=${ANDROID_SDK_ROOT}/ndk/${{ matrix.ndk_version }}
echo "::set-env name=NDK_ROOT::$NDK_ROOT"
export NUM_CPU=`python -c 'import multiprocessing as mp; print(mp.cpu_count())'`
echo "::set-env name=NUM_CPU::$NUM_CPU"
set
mkdir -p bins/${{ matrix.variation }}
mkdir -p logs/${{ matrix.variation }}
- name: Build Boost for Android on ${{ matrix.variation }}
run: CXXFLAGS="-std=c++14" ./build-android.sh --boost=${{ matrix.boost_version }} --arch=${{ matrix.abi }} --with-libraries=atomic,random,date_time,filesystem,system,thread,chrono,locale "${NDK_ROOT}"
- name: Prepare Binaries
run: |
set -x
mv build/out/* ${GITHUB_WORKSPACE}/bins/${{ matrix.variation }}/ || true
# Get rid of boost include directory cause it takes a long time to pack and upload (~20 min)
find ${GITHUB_WORKSPACE}/bins/${{ matrix.variation }} -type d -name "include" -exec rm -rf {} +
ls -alFR ${GITHUB_WORKSPACE}/bins
if: always()
- name: Upload Binaries
uses: actions/upload-artifact@v1
with:
name: binaries_${{ matrix.boost_version }}_${{ matrix.abi }}
path: ./bins
if: always()
- name: Prepare Logs
run: |
set -x
mv logs/*.log ${GITHUB_WORKSPACE}/logs/${{ matrix.variation }}/ || true
ls -alFR ${GITHUB_WORKSPACE}/logs
if: always()
- name: Upload Logs
uses: actions/upload-artifact@v1
with:
name: logs_${{ matrix.boost_version }}
path: ./logs
if: always()