-
-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (31 loc) · 1006 Bytes
/
CI.yml
File metadata and controls
31 lines (31 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: swift build -v
- name: Run Tests
run: swift test -v --enable-code-coverage
- name: Generate Test Coverage
run: |
set -x
XCTEST_PATH="$(find . -name '*.xctest')"
set -- $(xcrun llvm-cov report ${XCTEST_PATH}/Contents/MacOS/*PackageTests -instr-profile .build/debug/codecov/default.profdata -ignore-filename-regex='.build/|Tests/' | tail -1)
echo "$4" > .build/debug/codecov/percentage.txt
echo "PERCENTAGE=$4" >> $GITHUB_ENV
- name: Create Coverage Badge
uses: schneegans/dynamic-badges-action@v1.1.0
with:
auth: ${{ secrets.GIST_UPDATE }}
gistID: 642b37e378322dc191ae69d9762cd662
filename: DottedVersionVector-coverage.json
label: Coverage
message: ${{ env.PERCENTAGE }}
color: success