-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f44ba6
commit ff9f276
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} |