Skip to content

Commit aaf3efe

Browse files
authored
Merge pull request groue#1163 from groue/dev/ci
Tests with GitHub actions
2 parents 0a7e7d1 + d8f2989 commit aaf3efe

File tree

8 files changed

+331
-69
lines changed

8 files changed

+331
-69
lines changed

.ci/gemfiles/Gemfile.travis

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/CI.yml

Lines changed: 161 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,168 @@
1-
name: CI
1+
name: "GRDB CI"
22

33
on:
44
push:
5-
branches: [ master, development ]
5+
branches:
6+
- master
7+
- development
8+
paths:
9+
- 'GRDB/**'
10+
- 'Tests/**'
11+
- '.github/workflows/**'
12+
- 'Package.swift'
613
pull_request:
7-
branches: [ master, development ]
14+
paths:
15+
- 'GRDB/**'
16+
- 'Tests/**'
17+
- '.github/workflows/**'
18+
- 'Package.swift'
819

20+
concurrency:
21+
group: ${{ github.ref_name }}
22+
cancel-in-progress: true
923
jobs:
10-
build:
11-
12-
runs-on: macos-latest
13-
24+
macOS:
25+
name: macOS
26+
runs-on: ${{ matrix.runsOn }}
27+
timeout-minutes: 40
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
include:
32+
- xcode: "Xcode_13.3.1.app"
33+
runsOn: macOS-12
34+
name: "macOS 12, Xcode 13.3.1, Swift 5.6"
35+
shell: "/bin/zsh {0}"
36+
- xcode: "Xcode_13.2.1.app"
37+
runsOn: macOS-11
38+
name: "macOS 11, Xcode 13.2.1, Swift 5.5.2"
39+
shell: "/bin/zsh {0}"
40+
- xcode: "Xcode_13.1.app"
41+
runsOn: macOS-11
42+
name: "macOS 11, Xcode 13.1, Swift 5.5.1"
43+
shell: "/bin/zsh {0}"
44+
- xcode: "Xcode_13.0.app"
45+
runsOn: macOS-11
46+
name: "macOS 11, Xcode 13.0, Swift 5.5.0"
47+
shell: "/bin/zsh {0}"
48+
- xcode: "Xcode_12.5.1.app"
49+
runsOn: macOS-11
50+
name: "macOS 11, Xcode 12.5.1, Swift 5.4"
51+
shell: "/bin/zsh {0}"
52+
- xcode: "Xcode_12.4.app"
53+
runsOn: macOS-10.15
54+
name: "macOS 10.15, Xcode 12.4, Swift 5.3"
55+
shell: "/bin/zsh {0}"
56+
steps:
57+
- uses: actions/checkout@v2
58+
- name: ${{ matrix.name }}
59+
run: make test_framework_GRDBOSX_maxSwift
60+
iOS:
61+
name: iOS
62+
runs-on: ${{ matrix.runsOn }}
63+
timeout-minutes: 40
64+
strategy:
65+
fail-fast: false
66+
matrix:
67+
include:
68+
- xcode: "Xcode_13.3.1.app"
69+
runsOn: macOS-12
70+
name: "macOS 12, Xcode 13.3.1, Swift 5.6"
71+
shell: "/bin/zsh {0}"
72+
- xcode: "Xcode_12.4.app"
73+
runsOn: macOS-10.15
74+
name: "macOS 10.15, Xcode 12.4, Swift 5.3"
75+
shell: "/bin/zsh {0}"
76+
steps:
77+
- uses: actions/checkout@v2
78+
- name: ${{ matrix.name }}
79+
run: make test_framework_GRDBiOS_maxTarget_maxSwift
80+
SPM:
81+
name: SPM
82+
runs-on: ${{ matrix.runsOn }}
83+
timeout-minutes: 40
84+
strategy:
85+
fail-fast: false
86+
matrix:
87+
include:
88+
- xcode: "Xcode_13.3.1.app"
89+
runsOn: macOS-12
90+
name: "macOS 12, Xcode 13.3.1, Swift 5.6"
91+
shell: "/bin/zsh {0}"
92+
steps:
93+
- uses: actions/checkout@v2
94+
- name: ${{ matrix.name }}
95+
run: make test_SPM test_install_SPM
96+
SQLCipher3:
97+
name: SQLCipher3
98+
runs-on: ${{ matrix.runsOn }}
99+
timeout-minutes: 60
100+
strategy:
101+
fail-fast: false
102+
matrix:
103+
include:
104+
- xcode: "Xcode_13.3.1.app"
105+
runsOn: macOS-12
106+
name: "macOS 12, Xcode 13.3.1, Swift 5.6"
107+
shell: "/bin/zsh {0}"
108+
steps:
109+
- uses: actions/checkout@v2
110+
- name: ${{ matrix.name }}
111+
run: make test_framework_SQLCipher3Encrypted
112+
SQLCipher4:
113+
name: SQLCipher4
114+
runs-on: ${{ matrix.runsOn }}
115+
timeout-minutes: 60
116+
strategy:
117+
fail-fast: false
118+
matrix:
119+
include:
120+
- xcode: "Xcode_13.3.1.app"
121+
runsOn: macOS-12
122+
name: "macOS 12, Xcode 13.3.1, Swift 5.6"
123+
shell: "/bin/zsh {0}"
124+
- xcode: "Xcode_12.4.app"
125+
runsOn: macOS-10.15
126+
name: "macOS 10.15, Xcode 12.4, Swift 5.3"
127+
shell: "/bin/zsh {0}"
128+
steps:
129+
- uses: actions/checkout@v2
130+
- name: ${{ matrix.name }}
131+
run: make test_framework_SQLCipher4Encrypted
132+
CustomSQLite:
133+
name: CustomSQLite
134+
runs-on: ${{ matrix.runsOn }}
135+
timeout-minutes: 40
136+
strategy:
137+
fail-fast: false
138+
matrix:
139+
include:
140+
- xcode: "Xcode_13.3.1.app"
141+
runsOn: macOS-12
142+
name: "macOS 12, Xcode 13.3.1, Swift 5.6"
143+
shell: "/bin/zsh {0}"
144+
- xcode: "Xcode_12.4.app"
145+
runsOn: macOS-10.15
146+
name: "macOS 10.15, Xcode 12.4, Swift 5.3"
147+
shell: "/bin/zsh {0}"
148+
steps:
149+
- uses: actions/checkout@v2
150+
- name: ${{ matrix.name }}
151+
run: make test_framework_GRDBCustomSQLiteOSX
152+
XCFramework:
153+
name: XCFramework
154+
runs-on: ${{ matrix.runsOn }}
155+
timeout-minutes: 40
156+
strategy:
157+
fail-fast: false
158+
matrix:
159+
include:
160+
- xcode: "Xcode_13.3.1.app"
161+
runsOn: macOS-12
162+
name: "macOS 12, Xcode 13.3.1, Swift 5.6"
163+
shell: "/bin/zsh {0}"
14164
steps:
15-
- uses: actions/checkout@v2
16-
- name: Build
17-
run: swift build -v
18-
- name: Run tests
19-
run: swift test -v
165+
- uses: actions/checkout@v2
166+
- name: ${{ matrix.name }}
167+
run: make test_archive_GRDBOSX_xcframework
168+

Makefile

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# make distclean - Restore repository to a pristine state
99

1010
default: test
11-
smokeTest: test_framework_GRDBiOS_maxTarget test_framework_GRDBiOS_minTarget test_framework_SQLCipher4 test_framework_GRDBCustomSQLiteiOS_maxTarget test_SPM
11+
smokeTest: test_framework_GRDBiOS_maxTarget test_framework_GRDBiOS_minTarget test_framework_SQLCipher4Encrypted test_framework_GRDBCustomSQLiteiOS_maxTarget test_SPM
1212

1313
# Requirements
1414
# ============
@@ -180,7 +180,7 @@ test_framework: test_framework_darwin
180180
test_framework_darwin: test_framework_GRDB test_framework_GRDBCustom test_framework_SQLCipher test_SPM
181181
test_framework_GRDB: test_framework_GRDBOSX test_framework_GRDBWatchOS test_framework_GRDBiOS test_framework_GRDBtvOS
182182
test_framework_GRDBCustom: test_framework_GRDBCustomSQLiteOSX test_framework_GRDBCustomSQLiteiOS
183-
test_framework_SQLCipher: test_framework_SQLCipher3 test_framework_SQLCipher4
183+
test_framework_SQLCipher: test_framework_SQLCipher3 test_framework_SQLCipher3Encrypted test_framework_SQLCipher4 test_framework_SQLCipher4Encrypted
184184
test_archive: test_archive_GRDBOSX_xcframework
185185
test_install: test_install_manual test_install_SPM test_install_customSQLite test_install_GRDB_CocoaPods test_CocoaPodsLint
186186
test_CocoaPodsLint: test_CocoaPodsLint_GRDB
@@ -348,6 +348,21 @@ else
348348
@exit 1
349349
endif
350350

351+
test_framework_SQLCipher3Encrypted:
352+
ifdef POD
353+
cd Tests/CocoaPods/SQLCipher3 && \
354+
$(POD) install && \
355+
$(XCODEBUILD) \
356+
-workspace GRDBTests.xcworkspace \
357+
-scheme GRDBEncryptedTests \
358+
SWIFT_VERSION=$(MAX_SWIFT_VERSION) \
359+
build-for-testing test-without-building \
360+
$(XCPRETTY)
361+
else
362+
@echo CocoaPods must be installed for test_framework_SQLCipher3Encrypted
363+
@exit 1
364+
endif
365+
351366
test_framework_SQLCipher4:
352367
ifdef POD
353368
cd Tests/CocoaPods/SQLCipher4 && \
@@ -363,6 +378,21 @@ else
363378
@exit 1
364379
endif
365380

381+
test_framework_SQLCipher4Encrypted:
382+
ifdef POD
383+
cd Tests/CocoaPods/SQLCipher4 && \
384+
$(POD) install && \
385+
$(XCODEBUILD) \
386+
-workspace GRDBTests.xcworkspace \
387+
-scheme GRDBEncryptedTests \
388+
SWIFT_VERSION=$(MAX_SWIFT_VERSION) \
389+
build-for-testing test-without-building \
390+
$(XCPRETTY)
391+
else
392+
@echo CocoaPods must be installed for test_framework_SQLCipher4Encrypted
393+
@exit 1
394+
endif
395+
366396
test_SPM:
367397
# Add sanitizers when available: https://twitter.com/simjp/status/929140877540278272
368398
$(SWIFT) package clean
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1340"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "NO"
12+
buildForProfiling = "NO"
13+
buildForArchiving = "NO"
14+
buildForAnalyzing = "NO">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "564A2095226B8E18001F64F1"
18+
BuildableName = "GRDBTestsEncrypted.xctest"
19+
BlueprintName = "GRDBTestsEncrypted"
20+
ReferencedContainer = "container:GRDBTests.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "564A2095226B8E18001F64F1"
36+
BuildableName = "GRDBTestsEncrypted.xctest"
37+
BlueprintName = "GRDBTestsEncrypted"
38+
ReferencedContainer = "container:GRDBTests.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
</TestAction>
43+
<LaunchAction
44+
buildConfiguration = "Debug"
45+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
46+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
launchStyle = "0"
48+
useCustomWorkingDirectory = "NO"
49+
ignoresPersistentStateOnLaunch = "NO"
50+
debugDocumentVersioning = "YES"
51+
debugServiceExtension = "internal"
52+
allowLocationSimulation = "YES">
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
</ProfileAction>
61+
<AnalyzeAction
62+
buildConfiguration = "Debug">
63+
</AnalyzeAction>
64+
<ArchiveAction
65+
buildConfiguration = "Release"
66+
revealArchiveInOrganizer = "YES">
67+
</ArchiveAction>
68+
</Scheme>

Tests/CocoaPods/SQLCipher3/GRDBTests.xcodeproj/xcshareddata/xcschemes/GRDBTests.xcscheme

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,6 @@
2020
ReferencedContainer = "container:GRDBTests.xcodeproj">
2121
</BuildableReference>
2222
</BuildActionEntry>
23-
<BuildActionEntry
24-
buildForTesting = "YES"
25-
buildForRunning = "NO"
26-
buildForProfiling = "NO"
27-
buildForArchiving = "NO"
28-
buildForAnalyzing = "NO">
29-
<BuildableReference
30-
BuildableIdentifier = "primary"
31-
BlueprintIdentifier = "564A2095226B8E18001F64F1"
32-
BuildableName = "GRDBTestsEncrypted.xctest"
33-
BlueprintName = "GRDBTestsEncrypted"
34-
ReferencedContainer = "container:GRDBTests.xcodeproj">
35-
</BuildableReference>
36-
</BuildActionEntry>
3723
</BuildActionEntries>
3824
</BuildAction>
3925
<TestAction
@@ -61,16 +47,6 @@
6147
ReferencedContainer = "container:GRDBTests.xcodeproj">
6248
</BuildableReference>
6349
</TestableReference>
64-
<TestableReference
65-
skipped = "NO">
66-
<BuildableReference
67-
BuildableIdentifier = "primary"
68-
BlueprintIdentifier = "564A2095226B8E18001F64F1"
69-
BuildableName = "GRDBTestsEncrypted.xctest"
70-
BlueprintName = "GRDBTestsEncrypted"
71-
ReferencedContainer = "container:GRDBTests.xcodeproj">
72-
</BuildableReference>
73-
</TestableReference>
7450
</Testables>
7551
</TestAction>
7652
<LaunchAction

0 commit comments

Comments
 (0)