chore: SPM unit tests #2172
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: Build app | |
on: | |
pull_request: | |
types: | |
- opened | |
- edited | |
- synchronize | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
danger: | |
runs-on: ubuntu-latest | |
name: "Run Danger" | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Danger | |
uses: docker://ghcr.io/danger/danger-swift-with-swiftlint@sha256:ed07386a85f1328619b49e3cfd737ffce351fcd2620d858cfc997d7e3e401b59 #v3.15.0 | |
with: | |
args: --failOnErrors --no-publish-check --remove-previous-comments | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
unit-test: | |
runs-on: macos-13-large | |
timeout-minutes: 30 | |
name: "Unit Tests" | |
steps: | |
- name: Git - Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
ref: ${{ github.ref }} | |
- name: Select Xcode Version | |
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 | |
with: | |
xcode-version: '15.2' | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4 #v2.7.0 | |
with: | |
key: ${{ secrets.SSH_KEY }} | |
name: id_rsa_github_actions | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
- uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- uses: ruby/setup-ruby@d4526a55538b775af234ba4af27118ed6f8f6677 # v1.172.0 | |
with: | |
ruby-version: "3.2" | |
bundler-cache: true | |
- name: Run Unit Tests | |
shell: bash | |
run: | | |
bundle exec fastlane tests | |
env: | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
MATCH_GIT_PRIVATE_KEY: ${{ secrets.SSH_KEY }} | |
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} | |
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }} | |
MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} | |
MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} | |
SOURCE_BRANCH: ${{ github.head_ref }} | |
spm-test: | |
runs-on: macos-13-large | |
timeout-minutes: 20 | |
name: "Run unit tests (SPM)" | |
steps: | |
- name: Cancel previous jobs | |
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 | |
with: | |
access_token: ${{ github.token }} | |
- name: Git - Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
ref: ${{ github.ref }} | |
- name: Select Xcode Version | |
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 | |
with: | |
xcode-version: '15.2' | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4 #v2.7.0 | |
with: | |
key: ${{ secrets.SSH_KEY }} | |
name: id_rsa_github_actions | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
- uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- uses: ruby/setup-ruby@d4526a55538b775af234ba4af27118ed6f8f6677 # v1.172.0 | |
with: | |
ruby-version: "3.2" | |
bundler-cache: true | |
- name: Build SPM App | |
run: | | |
bundle exec fastlane test_spm | |
env: | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
MATCH_GIT_PRIVATE_KEY: ${{ secrets.SSH_KEY }} | |
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} | |
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }} | |
MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} | |
MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} | |
SOURCE_BRANCH: ${{ github.head_ref }} | |
build-and-upload-to-appetize: | |
needs: unit-test | |
runs-on: macos-13 | |
timeout-minutes: 45 | |
name: "Build and upload app to Appetize" | |
steps: | |
- name: Cancel previous jobs | |
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 | |
with: | |
access_token: ${{ github.token }} | |
- name: Git - Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
ref: ${{ github.ref }} | |
- name: Upload preview to Appetize | |
id: appetize-upload | |
uses: ./.github/actions/appetize-build | |
with: | |
build_type: 'preview' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
known-hosts: ${{ secrets.KNOWN_HOSTS }} | |
match-password: ${{ secrets.MATCH_PASSWORD }} | |
match-git-private-key: ${{ secrets.FASTLANE_PASSWORD }} | |
fastlane-session: ${{ secrets.FASTLANE_SESSION }} | |
fastlane-password: ${{ secrets.FASTLANE_PASSWORD }} | |
match-keychain-name: ${{ secrets.MATCH_KEYCHAIN_NAME }} | |
match-keychain-password: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} | |
appetize-api-token: ${{ secrets.APPETIZE_API_TOKEN }} | |
source-branch: ${{ github.head_ref || github.ref_name }} | |
pr-number: ${{ github.event.pull_request.number }} | |
slack-channel: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }} | |
slack-reporter-token: ${{ secrets.SLACK_REPORTER_BOT_TOKEN }} | |
github-run-id: ${{ github.run_id }} | |
- uses: peter-evans/find-comment@d5fe37641ad8451bdd80312415672ba26c86575e #v3.0.0 | |
if: ${{ success() }} | |
id: find_comment | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
body-includes: Appetize link | |
- uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 #v4.0.0 | |
if: ${{ success() }} | |
with: | |
body: | | |
Appetize link: ${{ env.APPETIZE_APP_URL }} | |
edit-mode: replace | |
comment-id: ${{ steps.find_comment.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
token: ${{ secrets.GITHUB_TOKEN }} |