Skip to content

Commit

Permalink
ci: check for minimum code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilioOjeda committed Nov 3, 2022
1 parent b1a9ece commit 3fe2a16
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build
on: [pull_request]

jobs:
build:
build-and-test:
name: Build & Test
runs-on: macos-12
steps:
Expand All @@ -16,4 +16,33 @@ jobs:
- name: Build Package
run: swift build
- name: Test Package
run: swift test
run: swift test --parallel --enable-code-coverage
- name: Install LLVM
run: |
brew list llvm || brew install llvm
brew outdated llvm || brew upgrade llvm
- name: Generate Code Coverage Report
uses: maxep/spm-lcov-action@0.3.1
with:
file-format: text
output-file: ./lcov.json
- name: Upload Code Coverage Report
uses: actions/upload-artifact@v3.1.1
with:
name: code-coverage-report
path: ./lcov.json
check-code-coverage:
name: Check for Code Coverage Threshold
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: Download Code Coverage Report
uses: actions/download-artifact@v3.0.1
with:
name: code-coverage-report
path: ./
- name: Check for Minimum Code Coverage
uses: bigmeech/gha-simple-coverage@0.1.4
with:
fail-if-below: 90
lcov-file-path: "./lcov.json"

0 comments on commit 3fe2a16

Please sign in to comment.