Skip to content

ALFMOB-33: Implement CI/CD using Github Actions #7

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

Merged
merged 31 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1bcf05e
ALFMOB-33: Add CI/CD pipeline for iOS
naveenmindera Nov 21, 2024
e172477
ALFMOB-33: Testing github actions
naveenmindera Nov 21, 2024
e34d8a4
ALFMOB-33: Fixed yml indendation
naveenmindera Nov 21, 2024
a8d162a
ALFMOB-33: Testing github actions
naveenmindera Nov 21, 2024
578356a
ALFMOB-33: Fixed yml indendation
naveenmindera Nov 21, 2024
b8c9381
ALFMOB-33: Removed scheduler
naveenmindera Nov 22, 2024
d632737
ALFMOB-33: Fixed yml indendation
naveenmindera Nov 22, 2024
d5e63e6
ALFMOB-33: Fixed yml indendation
naveenmindera Nov 22, 2024
da2d22a
ALFMOB-33: Renamed workflow
naveenmindera Nov 22, 2024
8f24f38
ALFMOB-33: Added fastlane too handle code signing
naveenmindera Nov 29, 2024
d6bb534
ALFMOB-33: Increment build number handled
naveenmindera Nov 29, 2024
402853b
ALFMOB-33: Handled TF build with fastlane
naveenmindera Dec 13, 2024
23ff9b6
ALFMOB-33: Update sh commands for build and test with fastlane known …
JoaoPinhoMinder Jan 29, 2025
a0c2f0c
ALFMOB-33: Add environment variables file and Brewfile
JoaoPinhoMinder Jan 29, 2025
b7dfe27
ALFMOB-33: Adjust environment variables and update script
JoaoPinhoMinder Jan 31, 2025
2f49792
ALFMOB-33: Test adding current branch and make it as string
JoaoPinhoMinder Jan 31, 2025
921160a
ALFMOB-33: Update branches definition
JoaoPinhoMinder Jan 31, 2025
439f738
ALFMOB-33: Rever the update branches definition
JoaoPinhoMinder Jan 31, 2025
9b0b2c5
ALFMOB-33: Remove '---' from workflow yml
JoaoPinhoMinder Jan 31, 2025
5eabdf7
ALFMOB-33: Revert having the current branch to trigger action
JoaoPinhoMinder Jan 31, 2025
88dbb56
ALFMOB-33: Update certificates lane and release build
JoaoPinhoMinder Feb 11, 2025
eaf2918
ALFMOB-33: Update Firebase SDK
JoaoPinhoMinder Feb 11, 2025
b808b0d
ALFMOB-33: Final clean-ups before review
JoaoPinhoMinder Feb 11, 2025
a8a53c5
ALFMOB-33: Code review improvements
JoaoPinhoMinder Feb 13, 2025
6b3c65e
ALFMOB-33: Code review improvements 2
JoaoPinhoMinder Feb 13, 2025
63ddbc4
ALFMOB-33: Code review improvements 3
JoaoPinhoMinder Feb 17, 2025
be0d14c
ALFMOB-33:Remove GoogleService-Info.plist files from the repository a…
JoaoPinhoMinder Feb 17, 2025
65aa42b
ALFMOB-33: Added GoogleService-Info.plist files to secrets
JoaoPinhoMinder Feb 17, 2025
7118af0
ALFMOB-33: Undo everything about git secrets
JoaoPinhoMinder Feb 18, 2025
2f98de4
ALFMOB-33: Code review improvements
JoaoPinhoMinder Feb 18, 2025
c402a5e
ALFMOB-33: Code review improvements
JoaoPinhoMinder Feb 19, 2025
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ fastlane/screenshots/**/*.png
fastlane/test_output
**/*/xcuserdata
Alfie/Packages/**/*/.swiftpm
Alfie/Packages/*/Package.resolved
Alfie/Packages/*/Package.resolved
90 changes: 90 additions & 0 deletions Alfie/.github/workflows/alfie.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Alfie CI/CD

on:
push:
branches:
- 'main'

pull_request:
branches:
- 'main'

workflow_dispatch:

env:
DEVELOPER_DIR: "/Applications/Xcode_16.2.app/Contents/Developer"
ARTIFACTS_PATH: "/tmp/alfie-artifacts"
DESTINATION: "platform=iOS Simulator,OS=latest,name=iPhone 16 Pro"
SPM_CLONED_DEPENDENCIES_PATH: "/tmp/SourcePackages"

jobs:
run-tests:
runs-on: macos-14
steps:
- name: Install Homebrew formulas
run: |
brew update
brew bundle install

- name: bundle install
run: |
gem install bundler --no-document
bundle install --jobs 4 --retry 3

- name: Checkout Code
uses: actions/checkout@v3

- name: Run Tests
run: bundle exec fastlane ios test --env default
env:
BUILD_CONFIGURATION: "Debug"

- name: Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: Test artifacts
path: |
${{ env.ARTIFACTS_PATH }}/*.xcresult
${{ env.ARTIFACTS_PATH }}/*.junit
retention-days: 7

release:
needs: run-tests
runs-on: macos-14
if: github.event_name == 'push'
steps:
- name: Install Homebrew formulas
run: |
brew update
brew bundle install

- name: bundle install
run: |
gem install bundler --no-document
bundle install --jobs 4 --retry 3

- name: Checkout Code
uses: actions/checkout@v3

- name: Set up SSH for Bitbucket
run: |
mkdir -p ~/.ssh
echo "${{ secrets.BITBUCKET_SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa bitbucket.org >> ~/.ssh/known_hosts

- name: Build and deploy release to TestFlight
run: bundle exec fastlane ios release --env default
env:
BUILD_CONFIGURATION: "Release"
APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
APPSTORE_CONNECT_KEY_CONTENT_BASE64: ${{ secrets.APPSTORE_CONNECT_KEY_CONTENT_BASE64 }}
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
APPSTORE_CONNECT_TEAM_ID: ${{ secrets.APPSTORE_CONNECT_TEAM_ID }}
APP_IDENTIFIER: ${{ secrets.APP_IDENTIFIER }}
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
ITUNESCONNECT_TEAM_ID: ${{ secrets.ITUNESCONNECT_TEAM_ID }}
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
77 changes: 32 additions & 45 deletions Alfie/Alfie.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
BE8B02342B616979007AE489 /* AlfieTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AlfieTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
BE8B023E2B616979007AE489 /* AlfieUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AlfieUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
C5C9C4C92D3571D800D5D70E /* AlfieKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = AlfieKit; sourceTree = "<group>"; };
FCA0B27E2CEF3F12000339F6 /* alfie.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = alfie.yml; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
Expand Down Expand Up @@ -118,6 +119,7 @@
BE8B021B2B616976007AE489 = {
isa = PBXGroup;
children = (
FCA0B27B2CEF3EE7000339F6 /* .github */,
C5C9C4C92D3571D800D5D70E /* AlfieKit */,
615E07D42CF6369900065ECF /* Alfie */,
615E06B92CF633FC00065ECF /* AlfieTests */,
Expand All @@ -137,6 +139,22 @@
name = Products;
sourceTree = "<group>";
};
FCA0B27B2CEF3EE7000339F6 /* .github */ = {
isa = PBXGroup;
children = (
FCA0B27D2CEF3EFB000339F6 /* workflows */,
);
path = .github;
sourceTree = "<group>";
};
FCA0B27D2CEF3EFB000339F6 /* workflows */ = {
isa = PBXGroup;
children = (
FCA0B27E2CEF3F12000339F6 /* alfie.yml */,
);
path = workflows;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -150,7 +168,6 @@
BE8B02202B616976007AE489 /* Sources */,
BE8B02212B616976007AE489 /* Frameworks */,
BE8B02222B616976007AE489 /* Resources */,
BAEFC2612B84AE5D00387C00 /* Upload DSYMs to Crashlytics */,
);
buildRules = (
);
Expand Down Expand Up @@ -356,29 +373,6 @@
shellScript = "if [ \"${ENABLE_PREVIEWS}\" = \"YES\" ]; then\n echo \"Building for Previews, ignore copy to avoid build loop issues.\"\n exit 0;\nfi\n\nif [ \"${CONFIGURATION}\" = \"Release\" ]; then\n SOURCE_CONFIG_PATH=$SRCROOT/Alfie/Configuration/Release/GoogleService-Info.plist\nelse \n SOURCE_CONFIG_PATH=$SRCROOT/Alfie/Configuration/Debug/GoogleService-Info.plist\nfi\n\nDESTINATION_CONFIG_PATH=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist\"\n\necho \"Will copy ${SOURCE_CONFIG_PATH} to ${DESTINATION_CONFIG_PATH}\"\ncp $SOURCE_CONFIG_PATH $DESTINATION_CONFIG_PATH\n";
showEnvVarsInLog = 0;
};
BAEFC2612B84AE5D00387C00 /* Upload DSYMs to Crashlytics */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 12;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}",
"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${PRODUCT_NAME}",
"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist",
"$(TARGET_BUILD_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/GoogleService-Info.plist",
"$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)",
);
name = "Upload DSYMs to Crashlytics";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run\"\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -552,10 +546,9 @@
CODE_SIGN_ENTITLEMENTS = Alfie/Alfie.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 0;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"Alfie/Preview Content\"";
DEVELOPMENT_TEAM = 74L475LDQT;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -570,10 +563,9 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.8.0;
MARKETING_VERSION = 0.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.mindera.alfie.debug;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
Expand All @@ -590,11 +582,9 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Alfie/Alfie.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 0;
DEVELOPMENT_ASSET_PATHS = "\"Alfie/Preview Content\"";
DEVELOPMENT_TEAM = 74L475LDQT;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
"EXCLUDED_SOURCE_FILE_NAMES[arch=*]" = "Mocks*";
Expand All @@ -610,10 +600,9 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.8.0;
MARKETING_VERSION = 0.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.mindera.alfie;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
Expand All @@ -629,7 +618,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 0;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MARKETING_VERSION = 0.8.0;
Expand All @@ -646,8 +635,7 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 0;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MARKETING_VERSION = 0.8.0;
Expand All @@ -664,7 +652,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 0;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 0.8.0;
PRODUCT_BUNDLE_IDENTIFIER = com.mindera.AlfieUITests;
Expand All @@ -679,8 +667,7 @@
BE8B02502B616979007AE489 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 0;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 0.8.0;
PRODUCT_BUNDLE_IDENTIFIER = com.mindera.AlfieUITests;
Expand Down Expand Up @@ -738,8 +725,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/apple/swift-collections.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.0.6;
kind = exactVersion;
version = 1.0.6;
};
};
99AB92D82D492FA800FD005D /* XCRemoteSwiftPackageReference "SwiftGenPlugin" */ = {
Expand All @@ -754,16 +741,16 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/pointfreeco/swift-snapshot-testing";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.15.4;
kind = exactVersion;
version = 1.15.4;
};
};
C511F4DA2D3EAA2100AB69D6 /* XCRemoteSwiftPackageReference "Alicerce" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Mindera/Alicerce.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.18.0;
kind = exactVersion;
version = 0.18.0;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Alfie/Alfie/Configuration/Debug/GoogleService-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
<key>GOOGLE_APP_ID</key>
<string>1:135458332827:ios:c49379c8588ea2eca5e63e</string>
</dict>
</plist>
</plist>
4 changes: 2 additions & 2 deletions Alfie/Alfie/Service/ServiceProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ final class ServiceProvider: ServiceProviderProtocol {
brandsService = BrandsService(bffClient: bffClient)
searchService = SearchService(bffClient: bffClient)
webViewConfigurationService = WebViewConfigurationService(bffClient: bffClient, log: log)
bagService = MockBagService()
wishlistService = MockWishlistService()
bagService = BagService()
wishlistService = WishlistService()
}

public func resetServices() {
Expand Down
2 changes: 2 additions & 0 deletions Alfie/Alfie/Views/WishlistView/WishlistView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ private extension WishlistView {
}
}

#if DEBUG
#Preview {
WishlistView(
viewModel: WishlistViewModel(
Expand All @@ -67,3 +68,4 @@ private extension WishlistView {
)
.environmentObject(Coordinator())
}
#endif
2 changes: 1 addition & 1 deletion Alfie/AlfieKit/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ let package = Package(
.package(url: "https://github.com/apple/swift-collections", exact: "1.0.6"),
.package(url: "https://github.com/apollographql/apollo-ios.git", exact: "1.7.1"),
.package(url: "https://github.com/braze-inc/braze-swift-sdk", exact: "8.0.1"),
.package(url: "https://github.com/firebase/firebase-ios-sdk.git", exact: "10.20.0"),
.package(url: "https://github.com/firebase/firebase-ios-sdk.git", exact: "10.22.1"),
.package(url: "https://github.com/kean/Nuke.git", exact: "12.4.0"),
.package(url: "https://github.com/Mindera/Alicerce.git", exact: "0.18.0"),
.package(url: "https://github.com/onmyway133/EasyStash.git", exact: "1.1.9")
Expand Down
Loading