Skip to content

Commit 14291d7

Browse files
Copilotfulldecent
andcommitted
Implement comprehensive CI testing using template workflow
Co-authored-by: fulldecent <[email protected]>
1 parent c560e90 commit 14291d7

File tree

2 files changed

+129
-11
lines changed

2 files changed

+129
-11
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,26 @@ jobs:
4949
with:
5050
name: generated-project
5151
path: OUTPUT/TestModule/
52-
test-generated-project:
53-
name: Test generated project using template workflow
52+
test-generated-project-swift-package:
53+
name: Test generated project - ${{ matrix.name }}
5454
needs: test-configure-script
55-
runs-on: macos-15
55+
runs-on: ${{ matrix.runsOn }}
56+
env:
57+
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
5658
timeout-minutes: 10
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
include:
63+
- xcode: "Xcode_16.3"
64+
runsOn: macos-latest
65+
name: "macOS, Xcode 16.3, Swift 6.1"
66+
- xcode: "Xcode_15.4"
67+
runsOn: macos-14
68+
name: "macOS 14, Xcode 15.4, Swift 5.10"
69+
- xcode: "Xcode_15.2"
70+
runsOn: macos-13
71+
name: "macOS 13, Xcode 15.2, Swift 5.9.2"
5772
steps:
5873
- uses: actions/checkout@v4
5974

@@ -63,18 +78,43 @@ jobs:
6378
name: generated-project
6479
path: TestModule/
6580

66-
- name: Select Xcode 16.1
67-
run: sudo xcode-select -s /Applications/Xcode_16.1.app
68-
69-
- name: Test generated Swift package
81+
- name: Swift Package Test
7082
run: |
83+
set -o pipefail
7184
cd TestModule
7285
swift build
7386
swift test
87+
88+
test-generated-project-example-app:
89+
name: Test generated project Example App - ${{ matrix.name }}
90+
needs: test-configure-script
91+
runs-on: ${{ matrix.runsOn }}
92+
env:
93+
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
94+
timeout-minutes: 10
95+
strategy:
96+
fail-fast: false
97+
matrix:
98+
include:
99+
- xcode: "Xcode_16.3"
100+
runsOn: macos-latest
101+
name: "iOS Simulator"
102+
destination: "platform=iOS Simulator,name=iPhone 15 Pro"
103+
- xcode: "Xcode_15.4"
104+
runsOn: macos-14
105+
name: "iOS Simulator"
106+
destination: "platform=iOS Simulator,name=iPhone 15 Pro"
107+
steps:
108+
- uses: actions/checkout@v4
109+
110+
- name: Download generated project
111+
uses: actions/download-artifact@v4
112+
with:
113+
name: generated-project
114+
path: TestModule/
74115

75-
- name: Test generated Example project
116+
- name: Build Example App
76117
run: |
118+
set -o pipefail
77119
cd TestModule/Example
78-
xcodebuild -project Example.xcodeproj -scheme Example -destination "platform=iOS Simulator,name=iPhone 15,OS=18.1" clean build
79-
# delegate-to-template-workflow:
80-
# Don't know how to do this
120+
xcodebuild -project Example.xcodeproj -scheme Example -destination "${{ matrix.destination }}" clean build

.github/workflows/template-ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: "xxPROJECTxNAMExx CI"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'Sources/**'
9+
- 'Tests/**'
10+
- '.github/workflows/**'
11+
- 'Package.swift'
12+
- 'Example/**'
13+
pull_request:
14+
paths:
15+
- 'Sources/**'
16+
- 'Tests/**'
17+
- '.github/workflows/**'
18+
- 'Package.swift'
19+
- 'Example/**'
20+
workflow_call:
21+
22+
concurrency:
23+
group: ${{ github.ref_name }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
swift-package:
28+
name: ${{ matrix.name }}
29+
runs-on: ${{ matrix.runsOn }}
30+
env:
31+
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
32+
timeout-minutes: 10
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
include:
37+
- xcode: "Xcode_16.3"
38+
runsOn: macos-latest
39+
name: "macOS, Xcode 16.3, Swift 6.1"
40+
- xcode: "Xcode_15.4"
41+
runsOn: macos-14
42+
name: "macOS 14, Xcode 15.4, Swift 5.10"
43+
- xcode: "Xcode_15.2"
44+
runsOn: macos-13
45+
name: "macOS 13, Xcode 15.2, Swift 5.9.2"
46+
steps:
47+
- uses: actions/checkout@v4
48+
- name: Swift Package Test
49+
run: |
50+
set -o pipefail
51+
swift build
52+
swift test
53+
54+
example-app:
55+
name: Example App - ${{ matrix.name }}
56+
runs-on: ${{ matrix.runsOn }}
57+
env:
58+
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
59+
timeout-minutes: 10
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
include:
64+
- xcode: "Xcode_16.3"
65+
runsOn: macos-latest
66+
name: "iOS Simulator"
67+
destination: "platform=iOS Simulator,name=iPhone 15 Pro"
68+
- xcode: "Xcode_15.4"
69+
runsOn: macos-14
70+
name: "iOS Simulator"
71+
destination: "platform=iOS Simulator,name=iPhone 15 Pro"
72+
steps:
73+
- uses: actions/checkout@v4
74+
- name: Build Example App
75+
run: |
76+
set -o pipefail
77+
cd Example
78+
xcodebuild -project Example.xcodeproj -scheme Example -destination "${{ matrix.destination }}" clean build

0 commit comments

Comments
 (0)