Skip to content

Commit 1e00306

Browse files
[PATCH] Fix for yaml syntax (- WIP #130 -)
Changes in file .github/actions/fetch-test-reporter/action.yml: * corrected yaml syntax * pivot to use inputs instead of secrets * added support for coveralls-token input Changes in file .github/actions/purge-test-reporter/action.yml: * initial implementation Changes in file .github/tools/fetch-test-reporter: * submodule version bump Changes in file .github/workflows/Tests.yml: * related work Changes in file tests/check_pip: * followup from fixing GHI #400 * refactor ignore options * added more ways to allow public domain dependencies * ignore "UNKNOWN" result for BSD packages
1 parent ddbeae8 commit 1e00306

File tree

4 files changed

+215
-60
lines changed

4 files changed

+215
-60
lines changed

.github/actions/fetch-test-reporter/action.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,26 @@ inputs:
1414
rate limiting.
1515
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
1616
required: true
17+
codeclimate-token:
18+
description: |
19+
The token used to authenticate when performing codeclimate API operations.
20+
default: ''
21+
required: true
22+
cc-test-reporter-id:
23+
description: |
24+
The id used to report tests when performing codeclimate API operations.
25+
default: ''
26+
required: true
27+
deepsource-dsn:
28+
description: |
29+
The deepsource DSN when performing deepsource API operations.
30+
default: ''
31+
required: true
32+
coveralls-token:
33+
description: |
34+
The coveralls token used when performing coveralls API operations.
35+
default: ''
36+
required: true
1737
outputs:
1838
sha:
1939
description: "The SHA of the commit checked-out"
@@ -50,22 +70,23 @@ runs:
5070
if: ${{ !cancelled() && (steps.output_can_fetch.outputs.can_fetch == 'true') && (runner.os != 'Windows') && (github.repository == 'reactive-firewall/multicast') }}
5171
shell: bash
5272
env:
53-
CODECLIMATE_REPO_TOKEN: ${{ github.server_url == 'https://github.com' && secrets.CODECLIMATE_TOKEN || '' }}
54-
CC_TEST_REPORTER_ID: ${{ github.server_url == 'https://github.com' && secrets.CC_TEST_REPORTER_ID || '' }}
55-
DEEPSOURCE_DSN: ${{ github.server_url == 'https://github.com' && secrets.DEEPSOURCE_DSN || '' }}
73+
CODECLIMATE_REPO_TOKEN: ${{ github.server_url == 'https://github.com' && inputs.codeclimate-token || '' }}
74+
CC_TEST_REPORTER_ID: ${{ github.server_url == 'https://github.com' && inputs.cc-test-reporter-id || '' }}
75+
COVERALLS_REPO_TOKEN: ${{ github.server_url == 'https://github.com' && inputs.coveralls-token || '' }}
76+
DEEPSOURCE_DSN: ${{ github.server_url == 'https://github.com' && inputs.deepsource-dsn || '' }}
5677
run: |
5778
${{ github.workspace }}/.github/tools/fetch-test-reporter/fetch-test-reporter || exit $?
5879
- name: "Evaluate Fetch Task"
5980
id: fetch_outcome
6081
if: ${{ !cancelled() }}
6182
shell: bash
6283
run: |
63-
if [[ "${{ steps.output_can_fetch.outputs.can_fetch }}" == "true" ]] ; then
84+
if [[ "${{ steps.output_can_fetch.outputs.can_fetch }}" == "true" ]] ; then
6485
if [[ "${{ steps.fetch-test-reporter-main.outcome }}" == "success" ]] ; then
6586
THE_RESULT="success"
6687
else
6788
THE_RESULT="failure"
68-
fi
89+
fi ;
6990
else
7091
THE_RESULT="skipped"
7192
fi
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
name: 'Purge Code Coverage Tools'
3+
description: 'Purge various Code Coverage tools'
4+
author: 'Mr. Walls'
5+
branding:
6+
icon: 'delete'
7+
color: 'white'
8+
inputs:
9+
token:
10+
description: |
11+
The token used to authenticate when performing GitHub API operations.
12+
When running this action on github.com, the default value is sufficient. When running on
13+
GHES, you can pass a personal access token for github.com if you are experiencing
14+
rate limiting.
15+
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
16+
required: true
17+
codeclimate-token:
18+
description: |
19+
The token used to authenticate when performing codeclimate API operations.
20+
default: ''
21+
required: true
22+
cc-test-reporter-id:
23+
description: |
24+
The id used to report tests when performing codeclimate API operations.
25+
default: ''
26+
required: true
27+
deepsource-dsn:
28+
description: |
29+
The deepsource DSN when performing deepsource API operations.
30+
default: ''
31+
required: true
32+
coveralls-token:
33+
description: |
34+
The coveralls token used when performing coveralls API operations.
35+
default: ''
36+
required: true
37+
outputs:
38+
sha:
39+
description: "The SHA of the commit checked-out"
40+
value: ${{ steps.output_sha.outputs.sha || 'HEAD' }}
41+
can_purge:
42+
description: "Can the purge tool even be used?"
43+
value: ${{ steps.output_can_purge.outputs.can_purge || 'false' }}
44+
status:
45+
description: "The outcome of the purge test reporter action."
46+
value: ${{ steps.purge_outcome.outputs.status || 'cancelled' }}
47+
48+
runs:
49+
using: composite
50+
steps:
51+
- name: "Calculate Commit SHA"
52+
id: output_sha
53+
shell: bash
54+
run: |
55+
printf "sha=%s\n" $(git rev-parse --verify HEAD) >> "$GITHUB_OUTPUT"
56+
printf "FETCH_SHA=%s\n" $(git rev-parse --verify HEAD) >> "$GITHUB_ENV"
57+
- name: "Check has Purge Tool"
58+
id: output_can_purge
59+
shell: bash
60+
run: |
61+
if [[ -x ${{ github.workspace }}/.github/tools/fetch-test-reporter/purge-test-reporter ]] ; then
62+
printf "can_purge=true\n" >> "$GITHUB_OUTPUT"
63+
printf "::debug::%s\n" "Found ${{ github.workspace }}/.github/tools/fetch-test-reporter/purge-test-reporter"
64+
else
65+
printf "::warning, title='Missing tool':: %s\n" "Can't find purge-test-reporter tool."
66+
printf "can_purge=false\n" >> "$GITHUB_OUTPUT"
67+
fi
68+
- name: "Finalize test reporter tools on ${{ runner.os }}"
69+
id: purge-test-reporter-main
70+
if: ${{ !cancelled() && (steps.output_can_purge.outputs.can_purge == 'true') && (runner.os != 'Windows') && (github.repository == 'reactive-firewall/multicast') }}
71+
shell: bash
72+
env:
73+
CODECLIMATE_REPO_TOKEN: ${{ github.server_url == 'https://github.com' && inputs.codeclimate-token || '' }}
74+
CC_TEST_REPORTER_ID: ${{ github.server_url == 'https://github.com' && inputs.cc-test-reporter-id || '' }}
75+
COVERALLS_REPO_TOKEN: ${{ github.server_url == 'https://github.com' && inputs.coveralls-token || '' }}
76+
DEEPSOURCE_DSN: ${{ github.server_url == 'https://github.com' && inputs.deepsource-dsn || '' }}
77+
run: |
78+
${{ github.workspace }}/.github/tools/fetch-test-reporter/purge-test-reporter || exit $?
79+
- name: "Evaluate Fetch Task"
80+
id: purge_outcome
81+
if: ${{ !cancelled() }}
82+
shell: bash
83+
run: |
84+
if [[ "${{ steps.output_can_purge.outputs.can_purge }}" == "true" ]] ; then
85+
if [[ "${{ steps.purge-test-reporter-main.outcome }}" == "success" ]] ; then
86+
THE_RESULT="success"
87+
else
88+
THE_RESULT="failure"
89+
fi ;
90+
else
91+
THE_RESULT="skipped"
92+
fi
93+
printf "status=%s\n" "${THE_RESULT}" >> "$GITHUB_OUTPUT"
94+
if [[ "${THE_RESULT}" == "failure" ]] ; then
95+
exit 1
96+
else
97+
exit 0
98+
fi

0 commit comments

Comments
 (0)