[#5] [iOS] Setup CI: Github Actions #38
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: Running iOS tests | |
on: | |
pull_request: | |
types: [opened, reopened, edited, synchronize] | |
permissions: | |
actions: write | |
checks: write | |
contents: write | |
issues: write | |
pull-requests: write | |
statuses: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
ios_test: | |
name: Running tests in iOS | |
runs-on: macos-latest | |
defaults: | |
run: | |
working-directory: ./sample/ios | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v3 | |
id: bunlderCache | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-gems- | |
- name: Setup Java JDK | |
uses: actions/[email protected] | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Remove the old sample project | |
run: rm -rf sample | |
working-directory: ./ | |
- name: Generate the new sample project | |
run: sh make.sh --bundle-id co.nimble.kmm.sample --bundle-id-staging co.nimble.kmm.sample.staging --project-name sample --ios-version 14.0 | |
working-directory: ./ | |
- name: Bundle install | |
run: bundle install --path vendor/bundle | |
- name: Cache Pods | |
uses: actions/cache@v3 | |
id: cocoapodCache | |
with: | |
path: Pods | |
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pods- | |
- name: Generate KMM frameworks for Cocoapods | |
run: | | |
pwd | |
cd .. | |
pwd | |
./gradlew generateDummyFramework | |
- name: Install Pods Dependencies | |
run: bundle exec pod install | |
- name: Build and Test | |
run: bundle exec fastlane buildAndTest | |
env: | |
CI: true | |
- name: Clean up previous code coverage report | |
run: bundle exec fastlane cleanUpOutput | |
- name: Review pull request by Danger | |
uses: MeilCli/danger-action@v5 | |
with: | |
plugins_file: 'ios/Gemfile' | |
install_path: 'ios/vendor/bundle' | |
danger_file: 'ios/Dangerfile' | |
danger_id: 'danger-pr' | |
env: | |
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }} |