Skip to content

Merge pull request #77 from Matejkob/refactor-unit-tests #87

Merge pull request #77 from Matejkob/refactor-unit-tests

Merge pull request #77 from Matejkob/refactor-unit-tests #87

Workflow file for this run

name: Test_SwiftPM
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app
jobs:
test:
runs-on: macos-13
steps:
- name: Checkout to the branch
uses: actions/checkout@v3
- name: Install Swift
uses: slashmo/install-swift@v0.4.0
with:
version: swift-5.9-DEVELOPMENT-SNAPSHOT-2023-10-04-a
- name: Build
run: |
export TOOLCHAINS=swift
swift build
- name: Run tests
run: |
swift test -Xswiftc -Xfrontend -Xswiftc -dump-macro-expansions --enable-code-coverage
- name: Gather code coverage
run: |
BUILD_PATH=$(swift build --show-bin-path)
xcrun llvm-cov report \
$BUILD_PATH/swift-spyablePackageTests.xctest/Contents/MacOS/swift-spyablePackageTests \
-instr-profile=$BUILD_PATH/codecov/default.profdata \
-ignore-filename-regex=".build|Tests" -use-color
xcrun llvm-cov export -format="lcov" \
$BUILD_PATH/swift-spyablePackageTests.xctest/Contents/MacOS/swift-spyablePackageTests \
-instr-profile=$BUILD_PATH/codecov/default.profdata \
-ignore-filename-regex=".build|Tests" > coverage_report.lcov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage_report.lcov
verbose: true