generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 83
82 lines (73 loc) · 2.37 KB
/
test-android.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
name: CI-android
on: [push, pull_request, workflow_dispatch]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- windows-2022
- macos-12
qt:
- version: "5.15.2"
ndk-version: r21e
modules:
example-archives: qtbase qtsensors
example-modules:
- version: "6.3.2"
ndk-version: r21e
modules: qtsensors
example-archives: qtbase
example-modules: qtsensors
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: action/
- run: |
cd action
npm ci || npm install
shell: bash
- run: |
cd action
npm run build
- name: Install Qt
uses: ./
with:
target: android
modules: ${{ matrix.qt.modules }}
version: ${{ matrix.qt.version }}
examples: true
example-archives: ${{ matrix.qt.example-archives }}
example-modules: ${{ matrix.qt.example-modules }}
- name: Install Android NDK
shell: bash
# Links to NDK are at https://github.com/android/ndk/wiki/Unsupported-Downloads
run: |
if [[ "${RUNNER_OS}" == "Linux" ]]; then
export TARGET_ARCH="linux"
elif [[ "${RUNNER_OS}" == "Windows" ]]; then
export TARGET_ARCH="windows"
else
export TARGET_ARCH="darwin"
fi
export NDK_VER_NUM=$(echo ${{ matrix.qt.ndk-version }} | sed -e 's/r(\d+).*/$1/g')
# If it's less than 23, append -x86_64
if (( "${NDK_VER_NUM}" < 23 )); then
export TARGET_ARCH="${TARGET_ARCH}-x86_64"
fi;
curl -O "https://dl.google.com/android/repository/android-ndk-${{ matrix.qt.ndk-version }}-${TARGET_ARCH}.zip"
unzip "android-ndk-${{ matrix.qt.ndk-version }}-${TARGET_ARCH}.zip"
- name: Build test project
env:
QT_VERSION: ${{ matrix.qt.version }}
run: |
export ANDROID_NDK_ROOT=$(pwd)/android-ndk-${{ matrix.qt.ndk-version }}
cd ../Qt/Examples/Qt-${{ matrix.qt.version }}/sensors/accelbubble
qmake || qmake.bat
make
shell: bash