Skip to content

Commit 7deb2dd

Browse files
committed
ci: Update code coverage action step
1 parent f93373d commit 7deb2dd

File tree

6 files changed

+55
-38
lines changed

6 files changed

+55
-38
lines changed

.github/workflows/test_macos13_x86_64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818

1919
jobs:
2020
testMacOS13:
21-
name: "⚗️ macOS 13"
21+
name: "⚗️ macOS 13 (Intel)"
2222
runs-on: macos-13
2323

2424
strategy:

.github/workflows/test_macos14_arm64.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,13 @@ jobs:
5757
- name: "🏗 Use Xcode 15.3"
5858
run: sudo xcode-select -switch /Applications/Xcode_15.3.app
5959

60-
- name: "🛠 Prepare Tools"
61-
run: |
62-
sh Support/prepare_build_tools
63-
6460
- name: "⚗️ Run tests"
6561
run: |
62+
sh Support/prepare_build_tools
6663
sh Support/build_test
6764
68-
- name: "⬆️ Upload code coverage"
69-
run: |
70-
bash <(curl -s https://codecov.io/bash) -J 'PactSwiftMockServer'
65+
- name: "⬆️ Upload coverage reports"
66+
uses: codecov/codecov-action@v3
67+
with:
68+
override_branch: ${{ github.ref_name }}
69+
token: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PactSwiftMockServer
22

3-
[![Build and Test](https://github.com/surpher/PactSwiftMockServer/actions/workflows/build_test.yml/badge.svg?branch=main)](https://github.com/surpher/PactSwiftMockServer/actions/workflows/build_test.yml)
3+
[![Build and Test](https://github.com/surpher/PactSwiftMockServer/actions/workflows/build_test.yml/badge.svg)](https://github.com/surpher/PactSwiftMockServer/actions/workflows/build_test.yml)
44
[![MIT License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](LICENSE.md)
55
[![codecov](https://codecov.io/gh/surpher/PactSwiftMockServer/branch/main/graph/badge.svg?token=0LYZVF36I9)](https://codecov.io/gh/surpher/PactSwiftMockServer)
66

Support/build_test

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@
1919

2020
set -euo pipefail
2121

22+
SOURCE_DIR="${BASH_SOURCE[0]%/*}"
23+
24+
# "import"
25+
source "$SOURCE_DIR/utils.sh"
26+
27+
# Properties
2228
SCHEME=${SCHEME:-"PactSwiftMockServer-macOS"}
2329
DESTINATION=${DESTINATION:-"arch=arm64"}
30+
DERIVED_DATA_PATH=".build/DerivedData"
2431

25-
set -o pipefail && xcodebuild clean test \
26-
-project PactSwiftMockServer.xcodeproj \
27-
-scheme "$SCHEME" \
28-
-destination "$DESTINATION" \
29-
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES \
30-
GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcbeautify
32+
# Run tests
33+
executeCommand "xcodebuild clean test -project \"PactSwiftMockServer.xcodeproj\" -scheme \"$SCHEME\" -destination \"$DESTINATION\" -enableCodeCoverage YES -derivedDataPath \"$DERIVED_DATA_PATH\" GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES | xcbeautify"

Support/prepare_build_tools

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717
# IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1818
#
1919

20+
set -euo pipefail
21+
22+
SOURCE_DIR="${BASH_SOURCE[0]%/*}"
23+
24+
# "import"
25+
source "$SOURCE_DIR/utils.sh"
26+
2027
brew install cbindgen
2128
brew install doxygen
2229

@@ -25,3 +32,12 @@ if [[ "$CI" == false ]]; then
2532
brew install xcbeautify
2633
brew install swiftlint
2734
fi
35+
36+
function installRustTools {
37+
executeCommand "brew install cbindgen doxygen"
38+
}
39+
40+
function installXcodeTools {
41+
executeCommand "brew tap thii/xcbeautify https://github.com/thii/xcbeautify.git"
42+
executeCommand "brew install xcbeautify swiftlint"
43+
}

codecov.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
11
codecov:
2-
notify:
3-
require_ci_to_pass: yes
2+
notify: {}
3+
require_ci_to_pass: true
4+
5+
comment:
6+
behavior: default
7+
layout: header, diff
8+
require_changes: false
49

510
coverage:
611
precision: 2
12+
range:
13+
- 75.0
14+
- 100.0
715
round: down
8-
range: "75...100"
9-
1016
status:
11-
project: yes
12-
patch: yes
13-
changes: no
17+
changes: false
18+
patch: true
19+
project: true
1420

15-
ignore:
16-
- "Tests/**/*"
17-
- "Tests"
18-
- "Resources/**/*"
19-
- "Resources"
20-
- "Support/**/*"
21-
- "Support"
21+
ignore:
22+
- (?s:Resources/.*/[^\/]+)\Z
23+
- ^Resources.*
24+
- (?s:Support/.*/[^\/]+)\Z
25+
- ^Support.*
2226

2327
parsers:
2428
gcov:
2529
branch_detection:
26-
conditional: yes
27-
loop: yes
28-
method: no
29-
macro: no
30-
31-
comment:
32-
layout: "header, diff"
33-
behavior: default
34-
require_changes: no
30+
conditional: true
31+
loop: true
32+
macro: false
33+
method: false

0 commit comments

Comments
 (0)