File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed
generate_code_coverage_report/Sources/UpdatedFilesCollector Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 31
31
# The final matrix will be set as an env var in the GHA workflow,
32
32
# This env var, matrix, will be passed as a matrix in the next job of
33
33
# the workflow.
34
- ./scripts/health_metrics/get_updated_files.sh -p output.json
34
+ # If multiple podspecs need to be excluded, escaping space is required
35
+ # to split podspecs, e.g. get_updated_files.sh ... -e Firebase.podspec\ FirebaseABTesting.podspec
36
+ ./scripts/health_metrics/get_updated_files.sh -p output.json -e Firebase.podspec
35
37
echo "::set-output name=matrix::{\"include\":$( cat output.json )}"
36
38
# `podspecs` is to help determine if specs_testing job should be run.
37
39
echo "::set-output name=podspecs::$(cat output.json)"
Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ struct UpdatedFilesCollector: ParsableCommand {
56
56
} )
57
57
var outputSDKFileURL : URL ?
58
58
59
+ /// Exclude pods from spec testings.
60
+ @Option ( parsing: . upToNextOption, help: " Podspecs that will be excluded in the testings. " )
61
+ var excludePodspecs : [ String ] = [ ]
62
+
59
63
func run( ) throws {
60
64
var podspecsWithChangedFiles : [ SDKPodspec ] = [ ]
61
65
print ( " =============== list changed files =============== " )
@@ -78,7 +82,13 @@ struct UpdatedFilesCollector: ParsableCommand {
78
82
print ( " =============== paths of changed files =============== " )
79
83
print ( " ::set-output name= \( sdkPatterns. sdk) _run_job::true " )
80
84
for podspec in sdkPatterns. podspecs {
81
- podspecsWithChangedFiles. append ( SDKPodspec ( podspec: podspec) )
85
+ if !excludePodspecs. contains ( podspec) {
86
+ podspecsWithChangedFiles. append ( SDKPodspec ( podspec: podspec) )
87
+ } else if let outputPath = outputSDKFileURL {
88
+ print (
89
+ " \( podspec) was excluded and will not be written in \( outputPath. absoluteString) "
90
+ )
91
+ }
82
92
}
83
93
print ( " \( sdkPatterns. sdk) : \( changedFilePath) is updated under the pattern, \( pattern) " )
84
94
trigger_pod_test_for_coverage_report = true
Original file line number Diff line number Diff line change 15
15
set -ex
16
16
# Updated files in paths in file_patterns.json will trigger code coverage workflows.
17
17
# Updates in a pull request will generate a code coverage report in a PR.
18
-
19
- while getopts p: flag
18
+ exclude_specs= " "
19
+ while getopts " p:e: " flag
20
20
do
21
21
case " ${flag} " in
22
22
p) spec_output_file=${OPTARG} ;;
23
+ e) exclude_specs=${OPTARG[*]} ;;
23
24
esac
24
25
done
25
26
@@ -39,6 +40,7 @@ git diff --name-only remotes/origin/${GITHUB_BASE_REF} ${GITHUB_SHA} > updated_f
39
40
if [ -z $spec_output_file ] ; then
40
41
swift run UpdatedFilesCollector --changed-file-paths updated_files.txt --code-coverage-file-patterns ../file_patterns.json
41
42
else
42
- swift run UpdatedFilesCollector --changed-file-paths updated_files.txt --code-coverage-file-patterns ../file_patterns.json --output-sdk-file-url " ${spec_output_file} "
43
+ swift run UpdatedFilesCollector --changed-file-paths updated_files.txt --code-coverage-file-patterns ../file_patterns.json --output-sdk-file-url " ${spec_output_file} " --exclude-podspecs ${exclude_specs}
44
+
43
45
mv " ${spec_output_file} " " ${dir} "
44
46
fi
You can’t perform that action at this time.
0 commit comments