Skip to content

Only upload Linux.

Only upload Linux. #29

Workflow file for this run

name: CI
on:
push:
pull_request:
branches: ["*"]
tags-ignore: ["**"]
jobs:
macos-arm:
name: macOS (arm64)
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
run: swift test --enable-code-coverage
- name: Prepare coverage report
if: github.ref == 'refs/heads/master'
run: xcrun llvm-cov export -format="lcov" .build/debug/TimePackageTests.xctest/Contents/MacOS/TimePackageTests -instr-profile .build/debug/codecov/default.profdata > macos-arm64.lcov
- name: Cache coverage report
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: coverage-report-macos-arm64
path: macos-arm64.lcov
macos-intel:
name: macOS (x64)
runs-on: macos-15-large
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
run: swift test --enable-code-coverage
- name: Prepare coverage report
if: github.ref == 'refs/heads/master'
run: xcrun llvm-cov export -format="lcov" .build/debug/TimePackageTests.xctest/Contents/MacOS/TimePackageTests -instr-profile .build/debug/codecov/default.profdata > macos-x64.lcov
- name: Cache coverage report
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: coverage-report-macos-x64
path: macos-x64.lcov
linux:
name: Linux
runs-on: ubuntu-latest
container:
image: swift:6.0
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --security-opt apparmor=unconfined
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Test
run: swift test --enable-test-discovery --enable-code-coverage
- name: Prepare coverage report
if: github.ref == 'refs/heads/master'
run: $(dirname $(realpath $(which swift)))/llvm-cov export -format="lcov" .build/debug/TimePackageTests.xctest -instr-profile .build/debug/codecov/default.profdata > linux.lcov
- name: Cache coverage report
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: coverage-report-linux
path: linux.lcov
test-coverage:
name: Test Coverage
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: [macos-arm, macos-intel, linux]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore coverage reports
uses: actions/download-artifact@v4
with:
pattern: coverage-report-*
- name: Upload test coverage
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: linux.lcov
token: ${{ secrets.CODECOV_TOKEN }}