Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add integration test github action #23

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/integ-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Integration Test

on:
workflow_dispatch:
pull_request:
branches:
- main

permissions:
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
integ-test:
name: "Integration Test"
environment: "IntegTest"
runs-on: macos-14
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ format('{0}.integ-test', github.run_id) }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Inject Amplify Config File
run: |
aws s3 cp s3://${{ secrets.AWS_BUCKET_NAME }}/aws-appsync-apollo-extensions.json \
./Tests/IntegrationTestApp/IntegrationTestApp/amplify_outputs.json
- name: "Running Integration Test"
working-directory: "./Tests/IntegrationTestApp"
run: |
xcodebuild test \
-scheme IntegrationTestApp \
-destination "platform=iOS Simulator,name=iPhone 15,OS=latest" \
-sdk iphonesimulator \
| xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
21CFD7C92C76641E0071C70F /* AWSAppSyncApolloExtensions in Frameworks */ = {isa = PBXBuildFile; productRef = 21CFD7C82C76641E0071C70F /* AWSAppSyncApolloExtensions */; };
21FDF39C2C62B20200481EA0 /* APIKeyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21FDF39B2C62B20200481EA0 /* APIKeyTests.swift */; };
21FDF39E2C62B3E500481EA0 /* IntegrationTestBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21FDF39D2C62B3E500481EA0 /* IntegrationTestBase.swift */; };
60CE34112C9CDC1700DEAB45 /* amplify_outputs.json in Resources */ = {isa = PBXBuildFile; fileRef = 60CE34102C9CDC1700DEAB45 /* amplify_outputs.json */; };
605303912CA216590067C2EB /* amplify_outputs.json in Resources */ = {isa = PBXBuildFile; fileRef = 605303902CA216590067C2EB /* amplify_outputs.json */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -60,7 +60,8 @@
21B8F2D32C6298580042981F /* IAMTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IAMTests.swift; sourceTree = "<group>"; };
21FDF39B2C62B20200481EA0 /* APIKeyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIKeyTests.swift; sourceTree = "<group>"; };
21FDF39D2C62B3E500481EA0 /* IntegrationTestBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntegrationTestBase.swift; sourceTree = "<group>"; };
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>"; };
605303902CA216590067C2EB /* amplify_outputs.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = amplify_outputs.json; sourceTree = "<group>"; };
605303952CA349C30067C2EB /* IntegrationTestApp.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; name = IntegrationTestApp.xctestplan; path = IntegrationTestAppTests/IntegrationTestApp.xctestplan; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -92,6 +93,7 @@
218CFDAC2C5A8711009D70B9 = {
isa = PBXGroup;
children = (
605303952CA349C30067C2EB /* IntegrationTestApp.xctestplan */,
218CFDF32C5AD177009D70B9 /* aws-appsync-apollo-interceptors-swift */,
218CFDB72C5A8711009D70B9 /* IntegrationTestApp */,
218CFDC82C5A8714009D70B9 /* IntegrationTestAppTests */,
Expand All @@ -113,10 +115,10 @@
isa = PBXGroup;
children = (
21B8F2D02C5D8ACF0042981F /* graphql */,
60CE34102C9CDC1700DEAB45 /* amplify_outputs.json */,
218CFDB82C5A8711009D70B9 /* IntegrationTestAppApp.swift */,
218CFDBA2C5A8711009D70B9 /* ContentView.swift */,
218CFE192C5AD6B1009D70B9 /* Network.swift */,
605303902CA216590067C2EB /* amplify_outputs.json */,
218CFDBC2C5A8714009D70B9 /* Assets.xcassets */,
218CFDBE2C5A8714009D70B9 /* Preview Content */,
);
Expand Down Expand Up @@ -259,7 +261,7 @@
buildActionMask = 2147483647;
files = (
218CFE172C5AD66D009D70B9 /* SubscribeTodo.graphql in Resources */,
60CE34112C9CDC1700DEAB45 /* amplify_outputs.json in Resources */,
605303912CA216590067C2EB /* amplify_outputs.json in Resources */,
218CFE162C5AD66D009D70B9 /* schema.json in Resources */,
218CFDC02C5A8714009D70B9 /* Preview Assets.xcassets in Resources */,
218CFDBD2C5A8714009D70B9 /* Assets.xcassets in Resources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "218CFDB42C5A8711009D70B9"
BuildableName = "IntegrationTestApp.app"
BlueprintName = "IntegrationTestApp"
ReferencedContainer = "container:IntegrationTestApp.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:IntegrationTestAppTests/IntegrationTestApp.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "218CFDC42C5A8714009D70B9"
BuildableName = "IntegrationTestAppTests.xctest"
BlueprintName = "IntegrationTestAppTests"
ReferencedContainer = "container:IntegrationTestApp.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "218CFDB42C5A8711009D70B9"
BuildableName = "IntegrationTestApp.app"
BlueprintName = "IntegrationTestApp"
ReferencedContainer = "container:IntegrationTestApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "218CFDB42C5A8711009D70B9"
BuildableName = "IntegrationTestApp.app"
BlueprintName = "IntegrationTestApp"
ReferencedContainer = "container:IntegrationTestApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"configurations" : [
{
"id" : "EE3C60B0-4D48-491A-8917-D31CEBC8B96B",
"name" : "Configuration 1",
"options" : {

}
}
],
"defaultOptions" : {

},
"testTargets" : [
{
"target" : {
"containerPath" : "container:IntegrationTestApp.xcodeproj",
"identifier" : "218CFDC42C5A8714009D70B9",
"name" : "IntegrationTestAppTests"
}
}
],
"version" : 1
}