Skip to content

Commit 726c246

Browse files
committed
Reduce PR matrix and fix macOS NDK arch
1 parent c2e9cde commit 726c246

4 files changed

Lines changed: 7 additions & 300 deletions

File tree

.github/workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
1. **操作系统** (3种)
2020
- Windows (windows-latest)
21-
- macOS (macos-latest)
21+
- macOS (macos-13)
2222
- Ubuntu (ubuntu-latest)
2323

2424
2. **NDK 版本** (2种)

.github/workflows/macos-build.yml

Lines changed: 2 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -17,148 +17,13 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
include:
21-
# ============================================================
22-
# macOS: 16 jobs (1 PR + 15 master-only)
23-
# ============================================================
24-
- os: macos-latest
25-
os-name: macOS
26-
ndk: r27c
27-
build-system: ndk-build
28-
ffmpeg: no-ffmpeg
29-
page-size: 4kb
30-
run-on: always
31-
32-
# macOS: Additional 15 jobs (all configs except the one already in PR)
33-
- os: macos-latest
34-
os-name: macOS
35-
ndk: r26d
36-
build-system: cmake
37-
ffmpeg: with-ffmpeg
38-
page-size: 16kb
39-
run-on: master-only
40-
- os: macos-latest
41-
os-name: macOS
42-
ndk: r27c
43-
build-system: cmake
44-
ffmpeg: with-ffmpeg
45-
page-size: 16kb
46-
run-on: master-only
47-
- os: macos-latest
48-
os-name: macOS
49-
ndk: r26d
50-
build-system: ndk-build
51-
ffmpeg: with-ffmpeg
52-
page-size: 16kb
53-
run-on: master-only
54-
- os: macos-latest
55-
os-name: macOS
56-
ndk: r27c
57-
build-system: ndk-build
58-
ffmpeg: with-ffmpeg
59-
page-size: 16kb
60-
run-on: master-only
61-
- os: macos-latest
62-
os-name: macOS
63-
ndk: r26d
64-
build-system: cmake
65-
ffmpeg: no-ffmpeg
66-
page-size: 16kb
67-
run-on: master-only
68-
- os: macos-latest
69-
os-name: macOS
70-
ndk: r27c
71-
build-system: cmake
72-
ffmpeg: no-ffmpeg
73-
page-size: 16kb
74-
run-on: master-only
75-
- os: macos-latest
76-
os-name: macOS
77-
ndk: r26d
78-
build-system: ndk-build
79-
ffmpeg: no-ffmpeg
80-
page-size: 16kb
81-
run-on: master-only
82-
- os: macos-latest
83-
os-name: macOS
84-
ndk: r27c
85-
build-system: ndk-build
86-
ffmpeg: no-ffmpeg
87-
page-size: 16kb
88-
run-on: master-only
89-
- os: macos-latest
90-
os-name: macOS
91-
ndk: r26d
92-
build-system: cmake
93-
ffmpeg: with-ffmpeg
94-
page-size: 4kb
95-
run-on: master-only
96-
- os: macos-latest
97-
os-name: macOS
98-
ndk: r27c
99-
build-system: cmake
100-
ffmpeg: with-ffmpeg
101-
page-size: 4kb
102-
run-on: master-only
103-
- os: macos-latest
104-
os-name: macOS
105-
ndk: r26d
106-
build-system: ndk-build
107-
ffmpeg: with-ffmpeg
108-
page-size: 4kb
109-
run-on: master-only
110-
- os: macos-latest
111-
os-name: macOS
112-
ndk: r27c
113-
build-system: ndk-build
114-
ffmpeg: with-ffmpeg
115-
page-size: 4kb
116-
run-on: master-only
117-
- os: macos-latest
118-
os-name: macOS
119-
ndk: r26d
120-
build-system: cmake
121-
ffmpeg: no-ffmpeg
122-
page-size: 4kb
123-
run-on: master-only
124-
- os: macos-latest
125-
os-name: macOS
126-
ndk: r27c
127-
build-system: cmake
128-
ffmpeg: no-ffmpeg
129-
page-size: 4kb
130-
run-on: master-only
131-
- os: macos-latest
132-
os-name: macOS
133-
ndk: r26d
134-
build-system: ndk-build
135-
ffmpeg: no-ffmpeg
136-
page-size: 4kb
137-
run-on: master-only
138-
- os: macos-latest
139-
os-name: macOS
140-
ndk: r27c
141-
build-system: ndk-build
142-
ffmpeg: no-ffmpeg
143-
page-size: 4kb
144-
run-on: master-only
20+
include: ${{ fromJson(github.event_name == 'pull_request' && '[{"os":"macos-13","os-name":"macOS","ndk":"r27c","build-system":"ndk-build","ffmpeg":"no-ffmpeg","page-size":"4kb"}]' || '[{"os":"macos-13","os-name":"macOS","ndk":"r26d","build-system":"cmake","ffmpeg":"with-ffmpeg","page-size":"16kb"},{"os":"macos-13","os-name":"macOS","ndk":"r27c","build-system":"cmake","ffmpeg":"with-ffmpeg","page-size":"16kb"},{"os":"macos-13","os-name":"macOS","ndk":"r26d","build-system":"ndk-build","ffmpeg":"with-ffmpeg","page-size":"16kb"},{"os":"macos-13","os-name":"macOS","ndk":"r27c","build-system":"ndk-build","ffmpeg":"with-ffmpeg","page-size":"16kb"},{"os":"macos-13","os-name":"macOS","ndk":"r26d","build-system":"cmake","ffmpeg":"no-ffmpeg","page-size":"16kb"},{"os":"macos-13","os-name":"macOS","ndk":"r27c","build-system":"cmake","ffmpeg":"no-ffmpeg","page-size":"16kb"},{"os":"macos-13","os-name":"macOS","ndk":"r26d","build-system":"ndk-build","ffmpeg":"no-ffmpeg","page-size":"16kb"},{"os":"macos-13","os-name":"macOS","ndk":"r27c","build-system":"ndk-build","ffmpeg":"no-ffmpeg","page-size":"16kb"},{"os":"macos-13","os-name":"macOS","ndk":"r26d","build-system":"cmake","ffmpeg":"with-ffmpeg","page-size":"4kb"},{"os":"macos-13","os-name":"macOS","ndk":"r27c","build-system":"cmake","ffmpeg":"with-ffmpeg","page-size":"4kb"},{"os":"macos-13","os-name":"macOS","ndk":"r26d","build-system":"ndk-build","ffmpeg":"with-ffmpeg","page-size":"4kb"},{"os":"macos-13","os-name":"macOS","ndk":"r27c","build-system":"ndk-build","ffmpeg":"with-ffmpeg","page-size":"4kb"},{"os":"macos-13","os-name":"macOS","ndk":"r26d","build-system":"cmake","ffmpeg":"no-ffmpeg","page-size":"4kb"},{"os":"macos-13","os-name":"macOS","ndk":"r27c","build-system":"cmake","ffmpeg":"no-ffmpeg","page-size":"4kb"},{"os":"macos-13","os-name":"macOS","ndk":"r26d","build-system":"ndk-build","ffmpeg":"no-ffmpeg","page-size":"4kb"},{"os":"macos-13","os-name":"macOS","ndk":"r27c","build-system":"ndk-build","ffmpeg":"no-ffmpeg","page-size":"4kb"}]') }}
14521

14622
steps:
14723
- name: Checkout code
14824
uses: actions/checkout@v4
149-
150-
- name: Decide whether to run
151-
id: gate
152-
shell: bash
153-
run: |
154-
if [ "${{ matrix.run-on }}" = "always" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then
155-
echo "should_run=true" >> "$GITHUB_OUTPUT"
156-
else
157-
echo "should_run=false" >> "$GITHUB_OUTPUT"
158-
fi
15925

16026
- name: Setup NDK
161-
if: steps.gate.outputs.should_run == 'true'
16227
uses: nttld/setup-ndk@v1.4.2
16328
id: setup-ndk
16429
with:
@@ -167,23 +32,19 @@ jobs:
16732
add-to-path: true
16833

16934
- name: Install build tools
170-
if: steps.gate.outputs.should_run == 'true'
17135
run: brew install ninja
17236

17337
- name: Setup JDK 17
174-
if: steps.gate.outputs.should_run == 'true'
17538
uses: actions/setup-java@v3
17639
with:
17740
java-version: '17'
17841
distribution: 'temurin'
17942
cache: gradle
18043

18144
- name: Grant execute permission for scripts
182-
if: steps.gate.outputs.should_run == 'true'
18345
run: chmod +x gradlew tasks.sh
18446

18547
- name: Configure build parameters
186-
if: steps.gate.outputs.should_run == 'true'
18748
shell: bash
18849
run: |
18950
# Set build system flag
@@ -221,17 +82,15 @@ jobs:
22182
echo "ARTIFACT_NAME=apk-${OS_SHORT}-${NDK_SHORT}-${BUILD_SYS}-${FFMPEG_SHORT}-${PAGE_SHORT}" >> $GITHUB_ENV
22283
22384
- name: Setup project (ndk-build mode)
224-
if: steps.gate.outputs.should_run == 'true' && matrix.build-system == 'ndk-build'
85+
if: matrix.build-system == 'ndk-build'
22586
shell: bash
22687
run: ./tasks.sh --setup-project
22788

22889
- name: Build APK
229-
if: steps.gate.outputs.should_run == 'true'
23090
shell: bash
23191
run: ./tasks.sh --release $BUILD_SYSTEM_FLAG $FFMPEG_FLAG $PAGE_SIZE_FLAG --build
23292

23393
- name: Find and rename APK
234-
if: steps.gate.outputs.should_run == 'true'
23594
shell: bash
23695
run: |
23796
APK_FILE=$(find "cgeDemo/build" -name "*.apk" | grep -i release | head -n 1)
@@ -240,7 +99,6 @@ jobs:
24099
echo "APK saved as: artifacts/cgeDemo-${{ env.ARTIFACT_NAME }}.apk"
241100
242101
- name: Upload artifacts
243-
if: steps.gate.outputs.should_run == 'true'
244102
uses: actions/upload-artifact@v4
245103
with:
246104
name: ${{ env.ARTIFACT_NAME }}

.github/workflows/ubuntu-build.yml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,8 @@ jobs:
137137
steps:
138138
- name: Checkout code
139139
uses: actions/checkout@v4
140-
141-
- name: Decide whether to run
142-
id: gate
143-
shell: bash
144-
run: |
145-
if [ "${{ matrix.run-on }}" = "always" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then
146-
echo "should_run=true" >> "$GITHUB_OUTPUT"
147-
else
148-
echo "should_run=false" >> "$GITHUB_OUTPUT"
149-
fi
150140

151141
- name: Setup NDK
152-
if: steps.gate.outputs.should_run == 'true'
153142
uses: nttld/setup-ndk@v1.4.2
154143
id: setup-ndk
155144
with:
@@ -158,23 +147,20 @@ jobs:
158147
add-to-path: true
159148

160149
- name: Install build tools
161-
if: steps.gate.outputs.should_run == 'true'
162150
run: sudo apt-get update && sudo apt-get install -y ninja-build
163151

164152
- name: Setup JDK 17
165-
if: steps.gate.outputs.should_run == 'true'
166153
uses: actions/setup-java@v3
167154
with:
168155
java-version: '17'
169156
distribution: 'temurin'
170157
cache: gradle
171158

172159
- name: Grant execute permission for scripts (Unix)
173-
if: steps.gate.outputs.should_run == 'true' && runner.os != 'Windows'
160+
if: runner.os != 'Windows'
174161
run: chmod +x gradlew tasks.sh
175162

176163
- name: Configure build parameters
177-
if: steps.gate.outputs.should_run == 'true'
178164
shell: bash
179165
run: |
180166
# Set build system flag
@@ -212,17 +198,15 @@ jobs:
212198
echo "ARTIFACT_NAME=apk-${OS_SHORT}-${NDK_SHORT}-${BUILD_SYS}-${FFMPEG_SHORT}-${PAGE_SHORT}" >> $GITHUB_ENV
213199
214200
- name: Setup project (ndk-build mode)
215-
if: steps.gate.outputs.should_run == 'true' && matrix.build-system == 'ndk-build'
201+
if: matrix.build-system == 'ndk-build'
216202
shell: bash
217203
run: ./tasks.sh --setup-project
218204

219205
- name: Build APK
220-
if: steps.gate.outputs.should_run == 'true'
221206
shell: bash
222207
run: ./tasks.sh --release $BUILD_SYSTEM_FLAG $FFMPEG_FLAG $PAGE_SIZE_FLAG --build
223208

224209
- name: Find and rename APK
225-
if: steps.gate.outputs.should_run == 'true'
226210
shell: bash
227211
run: |
228212
APK_FILE=$(find "cgeDemo/build" -name "*.apk" | grep -i release | head -n 1)
@@ -231,7 +215,6 @@ jobs:
231215
echo "APK saved as: artifacts/cgeDemo-${{ env.ARTIFACT_NAME }}.apk"
232216
233217
- name: Upload artifacts
234-
if: steps.gate.outputs.should_run == 'true'
235218
uses: actions/upload-artifact@v4
236219
with:
237220
name: ${{ env.ARTIFACT_NAME }}

0 commit comments

Comments
 (0)