Skip to content

Commit

Permalink
ci: Update code coverage action step
Browse files Browse the repository at this point in the history
  • Loading branch information
surpher committed Apr 25, 2024
1 parent 8aa7829 commit ef473dc
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_macos13_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:

jobs:
testMacOS13:
name: "⚗️ macOS 13"
name: "⚗️ macOS 13 (Intel)"
runs-on: macos-13

strategy:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test_macos14_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ jobs:
run: |
sh Support/build_test
- name: "⬆️ Upload code coverage"
run: |
bash <(curl -s https://codecov.io/bash) -J 'PactSwiftMockServer'
- name: "⬆️ Upload coverage reports"
uses: codecov/codecov-action@v3
with:
override_branch: ${{ github.ref_name }}
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PactSwiftMockServer

[![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)
[![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)
[![MIT License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](LICENSE.md)
[![codecov](https://codecov.io/gh/surpher/PactSwiftMockServer/branch/main/graph/badge.svg?token=0LYZVF36I9)](https://codecov.io/gh/surpher/PactSwiftMockServer)

Expand Down
13 changes: 7 additions & 6 deletions Support/build_test
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ set -euo pipefail
SCHEME=${SCHEME:-"PactSwiftMockServer-macOS"}
DESTINATION=${DESTINATION:-"arch=arm64"}

set -o pipefail && xcodebuild clean test \
-project PactSwiftMockServer.xcodeproj \
-scheme "$SCHEME" \
-destination "$DESTINATION" \
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES \
GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcbeautify
executeCommand "xcodebuild clean test \
-project PactSwiftMockServer.xcodeproj \
-scheme \"$SCHEME\" \
-destination \"$DESTINATION\" \
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES \
GCC_GENERATE_TEST_COVERAGE_FILES=YES \
| xcbeautify"
47 changes: 24 additions & 23 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
codecov:
notify:
require_ci_to_pass: yes
notify: {}
require_ci_to_pass: true

comment:
behavior: default
layout: header, diff
require_changes: false

coverage:
precision: 2
range:
- 75.0
- 100.0
round: down
range: "75...100"

status:
project: yes
patch: yes
changes: no
changes: false
patch: true
project: true

ignore:
- "Tests/**/*"
- "Tests"
- "Resources/**/*"
- "Resources"
- "Support/**/*"
- "Support"
ignore:
- (?s:Tests/.*/[^\/]+)\Z
- ^Tests.*
- (?s:Resources/.*/[^\/]+)\Z
- ^Resources.*
- (?s:Support/.*/[^\/]+)\Z
- ^Support.*

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "header, diff"
behavior: default
require_changes: no
conditional: true
loop: true
macro: false
method: false

0 comments on commit ef473dc

Please sign in to comment.