Fix code signing for unit tests #452
Workflow file for this run
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
name: Emerge PR iOS Upload (Snapshots) | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
paths: [ios/**, .github/workflows/ios*] | |
jobs: | |
upload_emerge_snapshots: | |
runs-on: macos-14 | |
defaults: | |
run: | |
working-directory: ./ios | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Select Xcode version | |
run: sudo xcode-select -s '/Applications/Xcode_15.4.app/Contents/Developer' | |
- name: Set up Ruby env | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1.4 | |
bundler-cache: true | |
- name: Setup gems | |
run: exec ../.github/scripts/ios/setup.sh | |
- name: Build & upload iOS snapshot binary to Emerge Tools | |
run: bundle exec fastlane ios build_upload_emerge_snapshot | |
env: | |
EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_KEY }} | |
upload_swift_snapshot_testing_snapshots: | |
runs-on: macos-14 | |
defaults: | |
run: | |
working-directory: ./ios | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Select Xcode version | |
run: sudo xcode-select -s '/Applications/Xcode_15.4.app/Contents/Developer' | |
- name: Set up App Store Connect API Key | |
run: | | |
ABSOLUTE_KEY_PATH="$(pwd)/app_store_key.p8" | |
echo "${{ secrets.ASC_PRIVATE_KEY }}" > "$ABSOLUTE_KEY_PATH" | |
echo "AUTH_KEY_PATH=$ABSOLUTE_KEY_PATH" >> $GITHUB_ENV | |
- name: Generate new snapshots | |
env: | |
APP_STORE_KEY_ID: ${{ secrets.ASC_KEY_ID }} | |
APP_STORE_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }} | |
run: | | |
xcodebuild test \ | |
-scheme HackerNews \ | |
-sdk iphonesimulator \ | |
-destination 'platform=iOS Simulator,name=iPhone 14,OS=17.0' \ | |
-only-testing:HackerNewsTests/SwiftSnapshotTest \ | |
-allowProvisioningUpdates \ | |
-authenticationKeyPath "$AUTH_KEY_PATH" \ | |
-authenticationKeyID $APP_STORE_KEY_ID \ | |
-authenticationKeyIssuerID $APP_STORE_ISSUER_ID \ | |
ONLY_ACTIVE_ARCH=YES \ | |
TARGETED_DEVICE_FAMILY=1 \ | |
SUPPORTS_MACCATALYST=NO | |
continue-on-error: true | |
- name: Ruby setup | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.5 | |
bundler-cache: true | |
- name: Setup gems | |
run: gem install emerge | |
- name: Upload snapshots | |
env: | |
EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_KEY }} | |
run: | | |
emerge upload snapshots \ | |
--name "HackerNews Swift-Snapshot-Testing" \ | |
--id "com.emerge.hn.Hacker-News.swiftsnapshottesting" \ | |
--repo-name "EmergeTools/hackernews" \ | |
--client-library swift-snapshot-testing \ | |
--project-root . \ | |
--debug |