Skip to content

Commit

Permalink
test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhenry committed Nov 2, 2022
1 parent 8f44ba6 commit ff9f276
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift

name: Test

on:
push:
branches: [ "main" ]
pull_request:
types: [opened, reopened, synchronize]
branches: [ "main" ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
SNAPSHOT_ARTIFACTS: "/tmp/SNAPSHOTS"
DERIVEDDATA_PATH: "/tmp/DerivedData"
DEVELOPER_DIR: "/Applications/Xcode_14.1.app"

jobs:
build:

runs-on: macos-12

steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
${{ env.DERIVEDDATA_PATH }}/SourcePackages/checkouts/
key: ${{ runner.os }}-${{ hashFiles('**/Package.resolved') }}

- run: xcodebuild test -project Demo/Demo.xcodeproj -scheme Demo -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 13' -enableCodeCoverage YES -derivedDataPath ${{ env.DERIVEDDATA_PATH }}
- uses: michaelhenry/swifty-code-coverage@v1.0.1
with:
build-path: ${{ env.DERIVEDDATA_PATH }}
target: Demo.app
is-spm: false
ignore-filename-regex: 'Demo|ViewController|DerivedData|.libs'

- name: Upload to Codecov
run: |
bash <(curl https://codecov.io/bash) -f "coverage/*.info"
shell: bash
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Archive Failing UI Snapshots
uses: actions/upload-artifact@v3.1.1
if: failure()
with:
name: failing-ui-snapshots-artifact
path: |
${{ env.SNAPSHOT_ARTIFACTS }}

0 comments on commit ff9f276

Please sign in to comment.