Update unit-test.yml #20
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: Unit Test | |
on: | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
SwiftLint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: GitHub Action for SwiftLint | |
uses: norio-nomura/[email protected] | |
build: | |
name: Build and Test default scheme using iPhone simulator | |
runs-on: macos-15 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install and run 'bundle install' | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.6 | |
# runs 'bundle install' and caches installed gems automatically | |
bundler-cache: true | |
- name: Install npm | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- name: Install Amplify | |
run: npm install -g @aws-amplify/cli | |
- name: Setup Amplify | |
id: setupAmplify | |
run: bash ./update_amplify.sh -a $AWS_ACCESS_KEY_ID -s $AWS_SECRET_ACCESS_KEY -i $APP_ID -e $AMPLIFY_DEV_ENV -t $FACEBOOK_APP_ID -r $FACEBOOK_APP_SECRET | |
continue-on-error: true | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
APP_ID: ${{ secrets.APP_ID }} | |
AMPLIFY_DEV_ENV: ${{ secrets.AMPLIFY_DEV_ENV }} | |
FACEBOOK_APP_ID: ${{ secrets.FACEBOOK_APP_ID }} | |
FACEBOOK_APP_SECRET: ${{ secrets.FACEBOOK_APP_SECRET }} | |
- name: Recover From Setup Amplfy Error | |
if: steps.setupAmplify.outcome != 'success' | |
run: bash ./recover_from_error.sh | |
- name: Setup .mapbox file with MAPBOX_DOWNLOAD_TOKEN | |
run: echo $MAPBOX_DOWNLOAD_TOKEN >> ~/.mapbox | |
env: | |
MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN }} | |
- name: Setup .netrc with MAPBOX_DOWNLOAD_TOKEN | |
run: | | |
echo 'machine api.mapbox.com' >> ~/.netrc | |
echo 'login mapbox' >> ~/.netrc | |
echo "password $MAPBOX_DOWNLOAD_TOKEN" >> ~/.netrc | |
chmod 0600 ~/.netrc | |
env: | |
MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN }} | |
- name: Install Swiftgen | |
run: brew install swiftgen | |
- name: Check Amplify Version | |
run: amplify --version | |
- name: Set Xcode version | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '16.1' | |
- name: Build For Test | |
run: | | |
xcodebuild test -scheme animeal -project animeal.xcodeproj -destination "platform=iOS Simulator,name=iPhone 16,OS=18.1" -parallelizeTargets -showBuildTimingSummary | xcbeautify --renderer github-actions |