Skip to content

Update sample app

Update sample app #215

Workflow file for this run

name: Swift
on:
push:
branches: [ "**" ]
tags-ignore: [ "**" ]
pull_request_target:
workflow_dispatch:
jobs:
build:
env:
PACKAGE_NAME: XCResource
COVERAGE_FILE: ./coverage_report.lcov
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Cache SPM
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Build
run: swift build -v
- name: Run tests
run: swift test -v --enable-code-coverage
- name: Gather code coverage
run: |
xcrun llvm-cov export -format="lcov" \
.build/debug/${{ env.PACKAGE_NAME }}PackageTests.xctest/Contents/MacOS/${{ env.PACKAGE_NAME }}PackageTests \
-instr-profile .build/debug/codecov/default.profdata > ${{ env.COVERAGE_FILE }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: ${{ env.COVERAGE_FILE }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true