From c293ec908686c113e4ed933c4914687bef695261 Mon Sep 17 00:00:00 2001 From: Koichi Yokota Date: Mon, 19 Oct 2020 21:58:36 +0900 Subject: [PATCH 1/2] Reflect the test results --- .github/workflows/ci.yml | 16 ++++++++++------ .gitignore | 2 +- README.md | 4 ++-- scripts/llvm-cov-export.sh | 8 +++----- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a19595..97c8dc3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: - uses: actions/checkout@v2 - run: | swift --version - make swift-test + swift test --enable-test-discovery swift-test-linux: name: swift-test-linux - Swift ${{ matrix.swift-version }} @@ -65,7 +65,9 @@ jobs: fail-fast: false steps: - uses: actions/checkout@v2 - - run: make swift-test-linux SWIFT_VERSION=${{ matrix.swift-version }} + - run: | + swift --version + docker run --rm --volume "${PWD}:/src" --workdir "/src" swift:${{ matrix.swift-version }} swift test --enable-test-discovery codecov: name: codecov - Xcode ${{ matrix.xcode }} @@ -78,13 +80,15 @@ jobs: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app steps: - uses: actions/checkout@v2 - - name: export-codecov + - name: test run: | swift --version - make export-codecov - - name: codecov + swift test --enable-test-discovery + - name: export coverage if: success() + run: make export-codecov + - name: codecov uses: codecov/codecov-action@v1 with: - file: info.lcov + file: coverage.lcov token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index aa7f46a..ca56028 100644 --- a/.gitignore +++ b/.gitignore @@ -122,7 +122,7 @@ DerivedData/ /*.gcno # Codecov -info.lcov +coverage.lcov # Bundler /.bundle diff --git a/README.md b/README.md index 4a541c2..b0b6c96 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,13 @@ - Written in Swift. - Supports console, file, syslog, and oslog as loggers. -- Support automatic log roration about file logger. +- Supports automatic log roration about file logger. - Supports both Darwin and Linux. - Supports apple/swift-log. ## Examples -**Logging to console and file and use file log rotation feature.** +**Logging to console and file using file log rotation feature.** You can basically use CocoaPods, Carthage, and Swift Package Manager for integration. diff --git a/scripts/llvm-cov-export.sh b/scripts/llvm-cov-export.sh index e14cece..8ca9ada 100755 --- a/scripts/llvm-cov-export.sh +++ b/scripts/llvm-cov-export.sh @@ -1,9 +1,7 @@ #!/bin/sh -echo "Deleting info.lcov..." -rm -f info.lcov - -swift test --enable-test-discovery --enable-code-coverage +echo "Deleting coverage.lcov..." +rm -f coverage.lcov BIN_PATH="$(swift build --show-bin-path)" XCTEST_PATH="$(find ${BIN_PATH} -name '*.xctest')" @@ -24,4 +22,4 @@ esac $LLVM_COV export -format="lcov" "${COV_BIN}" \ -instr-profile=.build/debug/codecov/default.profdata \ -ignore-filename-regex=".build|Tests" \ - > info.lcov + > coverage.lcov From a657854dc1e5ec7eefeaf1675d17bbf7ae8335d4 Mon Sep 17 00:00:00 2001 From: Koichi Yokota Date: Mon, 19 Oct 2020 22:14:26 +0900 Subject: [PATCH 2/2] Fix codecov action --- .github/workflows/ci.yml | 7 ++----- scripts/llvm-cov-export.sh | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97c8dc3..2d2241b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,13 +80,10 @@ jobs: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app steps: - uses: actions/checkout@v2 - - name: test + - name: export-codecov run: | swift --version - swift test --enable-test-discovery - - name: export coverage - if: success() - run: make export-codecov + make export-codecov - name: codecov uses: codecov/codecov-action@v1 with: diff --git a/scripts/llvm-cov-export.sh b/scripts/llvm-cov-export.sh index 8ca9ada..0db3ed6 100755 --- a/scripts/llvm-cov-export.sh +++ b/scripts/llvm-cov-export.sh @@ -3,6 +3,8 @@ echo "Deleting coverage.lcov..." rm -f coverage.lcov +swift test --enable-test-discovery --enable-code-coverage + BIN_PATH="$(swift build --show-bin-path)" XCTEST_PATH="$(find ${BIN_PATH} -name '*.xctest')"