Skip to content

Commit b18a74c

Browse files
committed
Enable token-less coverage only for PRs with enable_pr_coverage
1 parent ac8f1d2 commit b18a74c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/reusable.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ name: Boost.CI
1515

1616
permissions:
1717
contents: read
18-
18+
1919
on:
2020
workflow_call:
2121
inputs:
@@ -65,7 +65,7 @@ on:
6565
type: boolean
6666
default: true
6767
enable_pr_coverage:
68-
description: "When enabled, coverage will be collected even without a $CODECOV_TOKEN, e.g for PRs where it usually is not available. Enabled by default."
68+
description: "When enabled, coverage will be collected even without a $CODECOV_TOKEN in PRs, where it usually is not available. Enabled by default."
6969
required: false
7070
type: boolean
7171
default: true
@@ -220,6 +220,7 @@ jobs:
220220
name: Generate job matrices
221221
run: |
222222
import json, math, os, sys, re
223+
print(f"{os.environ['GITHUB_EVENT_NAME']} build from {os.environ['GITHUB_ACTOR']} on {os.environ['GITHUB_REF_NAME']} ({os.environ['GITHUB_SHA']})")
223224
224225
# ═══════════════════════════════════════════════════════════════
225226
# Helper functions
@@ -284,7 +285,7 @@ jobs:
284285
job_filters.append({'multiarch': 'yes'})
285286
if not is_true('ENABLE_SANITIZERS'):
286287
job_filters.append({'sanitize': 'yes'})
287-
if not os.environ.get('CODECOV_TOKEN') and not is_true('ENABLE_PR_COVERAGE'):
288+
if not (os.environ.get('CODECOV_TOKEN') or (os.environ['GITHUB_EVENT_NAME'] == 'pull_request' and is_true('ENABLE_PR_COVERAGE'))):
288289
job_filters.append({'coverage': 'yes'})
289290
if not os.environ.get('COVERITY_SCAN_TOKEN'):
290291
job_filters.append({'coverity': 'yes'})
@@ -468,7 +469,7 @@ jobs:
468469
{"stdlib": "libc++",
469470
"compiler": "clang-7", "cxxstd": "11,14,17", "os": "ubuntu-latest", "container": "ubuntu:20.04"},
470471
{"name": "Clang w/ sanitizers", "sanitize": "yes", "stdlib": "libc++",
471-
"compiler": "clang-12", "cxxstd": "11,14,17,20", "os": "ubuntu-latest", "container": "ubuntu:20.04"},
472+
"compiler": "clang-12", "cxxstd": "11,14,17,20", "os": "ubuntu-latest", "container": "ubuntu:20.04"},
472473
# MacOS
473474
{"name": "MacOS sanitize w/ clang",
474475
"os": "macos-14", "compiler": "clang", "cxxstd": "11,14,17,20,2b", "sanitize": "yes"},

0 commit comments

Comments
 (0)