-
Notifications
You must be signed in to change notification settings - Fork 132
196 lines (157 loc) · 5.05 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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: CI
on:
push:
branches: [master]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
product:
runs-on: ubuntu-20.04
steps:
- uses: smorimoto/tune-github-hosted-runner-network@v1
- uses: actions/checkout@v3.5.3
- uses: ./.github/actions/setup-python
id: setup-python
# This step is referenced from product/README.md.
- name: Download Android Python builds
run: |
cd target
for version in $(./list-versions.py --build); do
target_dir=../maven/com/chaquo/python/target/$version
./download-target.sh $target_dir
./unpackage-target.sh $target_dir prefix
done
- name: Install Python requirements
run: |
${{ steps.setup-python.outputs.python-default }} -m \
pip install -r product/runtime/requirements-build.txt
- uses: ./.github/actions/create-local-properties
- name: Build
run: |
cd product
./gradlew publish -P cmakeBuildType=Release
- name: Upload Maven repository
uses: actions/upload-artifact@v3.1.2
with:
name: maven
# There's a fairly large per-file overhead, so exclude the hash files.
path: |
maven
!**/*.md5
!**/*.sha1
!**/*.sha256
!**/*.sha512
if-no-files-found: error
# This should match the version discovery logic in gradle-plugin/build.gradle.kts.
- name: List Android Gradle plugin versions
id: agp-versions
run: |
cd product/gradle-plugin/src/test/integration/data/base
(
echo -n versions=
echo *.* | jq -cR 'split(" ")'
) >> $GITHUB_OUTPUT
outputs:
agp-versions: ${{ steps.agp-versions.outputs.versions }}
docs:
runs-on: ubuntu-20.04
steps:
- uses: smorimoto/tune-github-hosted-runner-network@v1
- uses: actions/checkout@v3.5.3
- uses: ./.github/actions/setup-python
id: setup-python
- name: Install Python requirements
run: |
${{ steps.setup-python.outputs.python-default }} -m \
pip install -r product/runtime/requirements-build.txt \
-r product/runtime/requirements-docs.txt
- uses: ./.github/actions/create-local-properties
- name: Build
run: |
cd product
./gradlew docs
- uses: actions/upload-artifact@v3.1.2
with:
name: docs
path: |
product/runtime/build/docs
!**/.doctrees
if-no-files-found: error
gradlePython:
runs-on: ubuntu-20.04
steps:
- uses: smorimoto/tune-github-hosted-runner-network@v1
- uses: actions/checkout@v3.5.3
- uses: ./.github/actions/setup-python
- uses: ./.github/actions/create-local-properties
- name: Test
run: |
cd product
./gradlew gradle:testPython
demo:
needs: [product]
runs-on: ubuntu-20.04
steps:
- uses: smorimoto/tune-github-hosted-runner-network@v1
- uses: actions/checkout@v3.5.3
- uses: ./.github/actions/setup-python
- name: Download Maven repository
uses: actions/download-artifact@v3.0.2
with:
name: maven
path: maven
- name: Get keystore
env:
CHAQUO_JKS: ${{ secrets.CHAQUO_JKS }}
run: |
echo "$CHAQUO_JKS" | base64 -d > demo/chaquo.jks
- name: Build
run: |
cd demo
export JAVA_HOME=$JAVA_HOME_17_X64
./gradlew assembleRelease
- uses: actions/upload-artifact@v3.1.2
with:
name: demo
path: demo/app/build/outputs/apk/release
if-no-files-found: error
integration:
needs: [product]
strategy:
fail-fast: false
matrix:
agp-version: ${{ fromJSON(needs.product.outputs.agp-versions) }}
os: [linux, macos, windows]
include:
# To avoid clutter in the GitHub UI, OS versions are not added to the `os`
# dimension directly.
- os: linux
runs-on: ubuntu-20.04
- os: macos
runs-on: macos-12
- os: windows
runs-on: windows-2022
runs-on: ${{ matrix.runs-on }}
steps:
- uses: smorimoto/tune-github-hosted-runner-network@v1
- uses: actions/checkout@v3.5.3
- uses: ./.github/actions/setup-python
id: setup-python
- name: Download Maven repository
uses: actions/download-artifact@v3.0.2
with:
name: maven
path: maven
- name: Install Python requirements
run: |
${{ steps.setup-python.outputs.python-default }} -m \
pip install -r product/gradle-plugin/src/test/integration/requirements.txt
- uses: ./.github/actions/create-local-properties
- name: Test
run: |
cd product
CHAQUOPY_NO_BUILD=1 ./gradlew testIntegration-${{ matrix.agp-version }}