Skip to content

Commit f0a3f5c

Browse files
authored
ci: add integration test github action (#23)
1 parent 3f98d81 commit f0a3f5c

File tree

4 files changed

+168
-4
lines changed

4 files changed

+168
-4
lines changed

.github/workflows/integ-test.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Integration Test
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
permissions:
10+
id-token: write
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
integ-test:
18+
name: "Integration Test"
19+
environment: "IntegTest"
20+
runs-on: macos-14
21+
steps:
22+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
23+
with:
24+
persist-credentials: false
25+
- name: Configure AWS Credentials
26+
uses: aws-actions/configure-aws-credentials@v4
27+
with:
28+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
29+
role-session-name: ${{ format('{0}.integ-test', github.run_id) }}
30+
aws-region: ${{ secrets.AWS_REGION }}
31+
- name: Inject Amplify Config File
32+
run: |
33+
aws s3 cp s3://${{ secrets.AWS_BUCKET_NAME }}/aws-appsync-apollo-extensions.json \
34+
./Tests/IntegrationTestApp/IntegrationTestApp/amplify_outputs.json
35+
- name: "Running Integration Test"
36+
working-directory: "./Tests/IntegrationTestApp"
37+
run: |
38+
xcodebuild test \
39+
-scheme IntegrationTestApp \
40+
-destination "platform=iOS Simulator,name=iPhone 15,OS=latest" \
41+
-sdk iphonesimulator \
42+
| xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}

Tests/IntegrationTestApp/IntegrationTestApp.xcodeproj/project.pbxproj

+6-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
21CFD7C92C76641E0071C70F /* AWSAppSyncApolloExtensions in Frameworks */ = {isa = PBXBuildFile; productRef = 21CFD7C82C76641E0071C70F /* AWSAppSyncApolloExtensions */; };
3030
21FDF39C2C62B20200481EA0 /* APIKeyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21FDF39B2C62B20200481EA0 /* APIKeyTests.swift */; };
3131
21FDF39E2C62B3E500481EA0 /* IntegrationTestBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21FDF39D2C62B3E500481EA0 /* IntegrationTestBase.swift */; };
32-
60CE34112C9CDC1700DEAB45 /* amplify_outputs.json in Resources */ = {isa = PBXBuildFile; fileRef = 60CE34102C9CDC1700DEAB45 /* amplify_outputs.json */; };
32+
605303912CA216590067C2EB /* amplify_outputs.json in Resources */ = {isa = PBXBuildFile; fileRef = 605303902CA216590067C2EB /* amplify_outputs.json */; };
3333
/* End PBXBuildFile section */
3434

3535
/* Begin PBXContainerItemProxy section */
@@ -60,7 +60,8 @@
6060
21B8F2D32C6298580042981F /* IAMTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IAMTests.swift; sourceTree = "<group>"; };
6161
21FDF39B2C62B20200481EA0 /* APIKeyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIKeyTests.swift; sourceTree = "<group>"; };
6262
21FDF39D2C62B3E500481EA0 /* IntegrationTestBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntegrationTestBase.swift; sourceTree = "<group>"; };
63-
60CE34102C9CDC1700DEAB45 /* amplify_outputs.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = amplify_outputs.json; path = "../../../../tmp/apollo-extension-integ-test/amplify_outputs.json"; sourceTree = "<group>"; };
63+
605303902CA216590067C2EB /* amplify_outputs.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = amplify_outputs.json; sourceTree = "<group>"; };
64+
605303952CA349C30067C2EB /* IntegrationTestApp.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; name = IntegrationTestApp.xctestplan; path = IntegrationTestAppTests/IntegrationTestApp.xctestplan; sourceTree = "<group>"; };
6465
/* End PBXFileReference section */
6566

6667
/* Begin PBXFrameworksBuildPhase section */
@@ -92,6 +93,7 @@
9293
218CFDAC2C5A8711009D70B9 = {
9394
isa = PBXGroup;
9495
children = (
96+
605303952CA349C30067C2EB /* IntegrationTestApp.xctestplan */,
9597
218CFDF32C5AD177009D70B9 /* aws-appsync-apollo-interceptors-swift */,
9698
218CFDB72C5A8711009D70B9 /* IntegrationTestApp */,
9799
218CFDC82C5A8714009D70B9 /* IntegrationTestAppTests */,
@@ -113,10 +115,10 @@
113115
isa = PBXGroup;
114116
children = (
115117
21B8F2D02C5D8ACF0042981F /* graphql */,
116-
60CE34102C9CDC1700DEAB45 /* amplify_outputs.json */,
117118
218CFDB82C5A8711009D70B9 /* IntegrationTestAppApp.swift */,
118119
218CFDBA2C5A8711009D70B9 /* ContentView.swift */,
119120
218CFE192C5AD6B1009D70B9 /* Network.swift */,
121+
605303902CA216590067C2EB /* amplify_outputs.json */,
120122
218CFDBC2C5A8714009D70B9 /* Assets.xcassets */,
121123
218CFDBE2C5A8714009D70B9 /* Preview Content */,
122124
);
@@ -259,7 +261,7 @@
259261
buildActionMask = 2147483647;
260262
files = (
261263
218CFE172C5AD66D009D70B9 /* SubscribeTodo.graphql in Resources */,
262-
60CE34112C9CDC1700DEAB45 /* amplify_outputs.json in Resources */,
264+
605303912CA216590067C2EB /* amplify_outputs.json in Resources */,
263265
218CFE162C5AD66D009D70B9 /* schema.json in Resources */,
264266
218CFDC02C5A8714009D70B9 /* Preview Assets.xcassets in Resources */,
265267
218CFDBD2C5A8714009D70B9 /* Assets.xcassets in Resources */,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1540"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
9+
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "218CFDB42C5A8711009D70B9"
19+
BuildableName = "IntegrationTestApp.app"
20+
BlueprintName = "IntegrationTestApp"
21+
ReferencedContainer = "container:IntegrationTestApp.xcodeproj">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
</BuildActionEntries>
25+
</BuildAction>
26+
<TestAction
27+
buildConfiguration = "Debug"
28+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
29+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
31+
<TestPlans>
32+
<TestPlanReference
33+
reference = "container:IntegrationTestAppTests/IntegrationTestApp.xctestplan"
34+
default = "YES">
35+
</TestPlanReference>
36+
</TestPlans>
37+
<Testables>
38+
<TestableReference
39+
skipped = "NO"
40+
parallelizable = "YES">
41+
<BuildableReference
42+
BuildableIdentifier = "primary"
43+
BlueprintIdentifier = "218CFDC42C5A8714009D70B9"
44+
BuildableName = "IntegrationTestAppTests.xctest"
45+
BlueprintName = "IntegrationTestAppTests"
46+
ReferencedContainer = "container:IntegrationTestApp.xcodeproj">
47+
</BuildableReference>
48+
</TestableReference>
49+
</Testables>
50+
</TestAction>
51+
<LaunchAction
52+
buildConfiguration = "Debug"
53+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
54+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
55+
launchStyle = "0"
56+
useCustomWorkingDirectory = "NO"
57+
ignoresPersistentStateOnLaunch = "NO"
58+
debugDocumentVersioning = "YES"
59+
debugServiceExtension = "internal"
60+
allowLocationSimulation = "YES">
61+
<BuildableProductRunnable
62+
runnableDebuggingMode = "0">
63+
<BuildableReference
64+
BuildableIdentifier = "primary"
65+
BlueprintIdentifier = "218CFDB42C5A8711009D70B9"
66+
BuildableName = "IntegrationTestApp.app"
67+
BlueprintName = "IntegrationTestApp"
68+
ReferencedContainer = "container:IntegrationTestApp.xcodeproj">
69+
</BuildableReference>
70+
</BuildableProductRunnable>
71+
</LaunchAction>
72+
<ProfileAction
73+
buildConfiguration = "Release"
74+
shouldUseLaunchSchemeArgsEnv = "YES"
75+
savedToolIdentifier = ""
76+
useCustomWorkingDirectory = "NO"
77+
debugDocumentVersioning = "YES">
78+
<BuildableProductRunnable
79+
runnableDebuggingMode = "0">
80+
<BuildableReference
81+
BuildableIdentifier = "primary"
82+
BlueprintIdentifier = "218CFDB42C5A8711009D70B9"
83+
BuildableName = "IntegrationTestApp.app"
84+
BlueprintName = "IntegrationTestApp"
85+
ReferencedContainer = "container:IntegrationTestApp.xcodeproj">
86+
</BuildableReference>
87+
</BuildableProductRunnable>
88+
</ProfileAction>
89+
<AnalyzeAction
90+
buildConfiguration = "Debug">
91+
</AnalyzeAction>
92+
<ArchiveAction
93+
buildConfiguration = "Release"
94+
revealArchiveInOrganizer = "YES">
95+
</ArchiveAction>
96+
</Scheme>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"configurations" : [
3+
{
4+
"id" : "EE3C60B0-4D48-491A-8917-D31CEBC8B96B",
5+
"name" : "Configuration 1",
6+
"options" : {
7+
8+
}
9+
}
10+
],
11+
"defaultOptions" : {
12+
13+
},
14+
"testTargets" : [
15+
{
16+
"target" : {
17+
"containerPath" : "container:IntegrationTestApp.xcodeproj",
18+
"identifier" : "218CFDC42C5A8714009D70B9",
19+
"name" : "IntegrationTestAppTests"
20+
}
21+
}
22+
],
23+
"version" : 1
24+
}

0 commit comments

Comments
 (0)