-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
141 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ on: | |
required: true | ||
jobs: | ||
build-and-test: | ||
runs-on: macos-14 | ||
runs-on: macos-15 | ||
timeout-minutes: 20 | ||
|
||
steps: | ||
|
@@ -29,22 +29,95 @@ jobs: | |
CONFIG_E2E_CLOUD: ${{ secrets.CONFIG_E2E_CLOUD }} | ||
run: echo $CONFIG_E2E_CLOUD > FRTestHost/FRTestHost/SharedTestFiles/TestConfig/Config-live-01.json | ||
|
||
# Install the Apple certificate | ||
- name: Create p12 file from secret | ||
run: | | ||
# Create variables | ||
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | ||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | ||
PP_FILENAME=FRTestHost.mobileprovision | ||
# Import certificate and provisioning profile from secrets | ||
echo -n ${{ vars.BUILD_CERTIFICATE }} | base64 --decode --output $CERTIFICATE_PATH | ||
echo -n ${{ vars.FRTEST_HOST_PROVISIONING_PROFILE }} | base64 --decode --output $PP_FILENAME | ||
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | ||
cp $PP_FILENAME ~/Library/MobileDevice/Provisioning\ Profiles | ||
echo "Certificate path: $CERTIFICATE_PATH" | ||
echo "Keychain path: $KEYCHAIN_PATH" | ||
# Verify the file was successfully created | ||
if [ ! -f "$CERTIFICATE_PATH" ]; then | ||
echo "Failed to decode the certificate." | ||
exit 1 | ||
fi | ||
echo "RUNNER_TEMP: $RUNNER_TEMP" | ||
echo "Certificate path: $CERTIFICATE_PATH" | ||
echo "Keychain path: $KEYCHAIN_PATH" | ||
# Create temporary keychain | ||
echo "RUNNER_TEMP: $RUNNER_TEMP" | ||
echo "Certificate path: $CERTIFICATE_PATH" | ||
echo "Keychain path: $KEYCHAIN_PATH" | ||
security create-keychain -p "ForgeR0ck#1" $KEYCHAIN_PATH | ||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | ||
security unlock-keychain -p "ForgeR0ck#1" $KEYCHAIN_PATH | ||
# security unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" $KEYCHAIN_PATH | ||
# Import certificate to keychain | ||
echo "ABOUT TO IMPORT CERTIFICATE" | ||
echo "RUNNER_TEMP: $RUNNER_TEMP" | ||
echo "Certificate path: $CERTIFICATE_PATH" | ||
echo "Keychain path: $KEYCHAIN_PATH" | ||
echo "security import $CERTIFICATE_PATH -P "${{ vars.BUILD_CERTIFICATE_PASSWORD }}" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH" | ||
security import $CERTIFICATE_PATH -P "${{ vars.BUILD_CERTIFICATE_PASSWORD }}" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | ||
# security import $CERTIFICATE_PATH -P "ForgeR0ck#1" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to import the certificate." | ||
exit 1 | ||
fi | ||
# security list-keychain -d user -s $KEYCHAIN_PATH | ||
security find-identity -v -p codesigning $KEYCHAIN_PATH | ||
# security list-keychain -d user -s $KEYCHAIN_PATH | ||
# - name: Set up Ruby | ||
# uses: ruby/setup-ruby@v1 | ||
# with: | ||
# ruby-version: 2.7 | ||
|
||
# Set target Xcode version. For more details and options see: | ||
# https://github.com/actions/virtual-environments/blob/main/images/macos/macos-12-Readme.md | ||
- name: Select Xcode | ||
run: sudo xcode-select -switch /Applications/Xcode_15.4.app && /usr/bin/xcodebuild -version | ||
run: sudo xcode-select -switch /Applications/Xcode_16.2.app && /usr/bin/xcodebuild -version | ||
|
||
# List provisioning profiles | ||
- name: List provisioning profiles | ||
run: ls ~/Library/MobileDevice/Provisioning\ Profiles/ | ||
|
||
# Run all tests | ||
- name: Run tests | ||
run: xcodebuild test -scheme FRTestHost -workspace e2e/FRExample.xcworkspace -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 14,OS=17.5' -derivedDataPath DerivedData -enableCodeCoverage YES -resultBundlePath TestResults | xcpretty && exit ${PIPESTATUS[0]} | ||
run: xcodebuild test -scheme FRTestHost -workspace e2e/FRExample.xcworkspace -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.2' -derivedDataPath DerivedData TEST_TARGET_SIGNING=YES -enableCodeCoverage YES -resultBundlePath TestResults | grep -E 'Test Case|^Executed|error:' | ||
|
||
# Publish test results | ||
- name: Publish test results | ||
uses: kishikawakatsumi/xcresulttool@v1 | ||
- name: Parse Test Results | ||
uses: robotology/[email protected] | ||
with: | ||
path: TestResults.xcresult | ||
show-passed-tests: false | ||
if: success() || failure() | ||
|
||
# # Publish test results | ||
# - name: Publish test results | ||
# uses: kishikawakatsumi/xcresulttool@v1 | ||
# with: | ||
# path: TestResults.xcresult | ||
# show-passed-tests: false | ||
# if: success() || failure() | ||
|
||
# Send slack notification with result status | ||
- uses: 8398a7/action-slack@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters