From 7924d20c8c87e2691aad0d5231c97e9ba5b12239 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sat, 1 Aug 2020 13:50:45 -0400 Subject: [PATCH] Code coverage for linux --- .github/workflows/ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70f37b9..47559b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,4 +74,21 @@ jobs: - uses: fwal/setup-swift@v1 with: swift-version: ${{ matrix.swift }} + - run: swift test --parallel --enable-code-coverage + if: ${{ matrix.swift != '4.2' }} - run: swift test --parallel + if: ${{ matrix.swift == '4.2' }} + - name: Generate Coverage Report + if: ${{ matrix.swift != '4.2' }} + run: | + sudo apt-get -qq update && sudo apt-get -qq install llvm-10 + export b=$(swift build --show-bin-path) && llvm-cov-10 \ + export -format lcov \ + -instr-profile=$b/codecov/default.profdata \ + --ignore-filename-regex='\.build/' \ + $b/Path.swiftPackageTests.xctest \ + > info.lcov + - uses: codecov/codecov-action@v1 + if: ${{ matrix.swift != '4.2' }} + with: + file: ./info.lcov