Skip to content

Commit da09070

Browse files
committed
.github/workflows/testsuite.yml - switch from secrets to vars
We have been using secrets to store boolean variables. This results in our CI output being annoyingly corrupted by the security eliding. Github now supports "variables" as well as secrets, which are not elided in CI output. So switch our test framework controls to use the variable. Note the EXTENDED_TESTING variable was switched from to DO_EXTENDED_TESTING so that we can have both the EXTENDED_TESTING /secret/ and the new DO_EXTENDED_TESTING variable available at the same time as this commit is processed. Fixes Perl#20843
1 parent f86e19f commit da09070

File tree

1 file changed

+38
-35
lines changed

1 file changed

+38
-35
lines changed

.github/workflows/testsuite.yml

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
# When actions are enabled then it will - by default - run the 'Sanity Check' job.
1010
#
1111
# Testing other build configurations is controlled by the 'Secrets' configured
12-
# in 'Settings' -> 'Secrets' -> 'Actions' -> 'Repository Secrets':
13-
# - EXTENDED_TESTING: when this secret exists and is set to a true value then
12+
# in 'Settings' -> 'Secrets and Variables' -> 'Actions' -> 'Variables':
13+
# - DO_EXTENDED_TESTING: when this var exists and is set to a true value then
1414
# all build configurations are tested;
1515
# - CI_SKIP_SANITY: if set to a true value then most of the 'Sanity Check' job is skipped;
1616
# - CI_FORCE_LINUX: if set to a true value: run the 'linux' job;
@@ -33,18 +33,11 @@
3333
# * string containing only zeroes (i.e. '0', '0000')
3434
# * string containing only spaces and zeroes (i.e. '0 0 0 0')
3535
#
36-
# When setting a value it's best to set a long and complex value
37-
# since GitHub will mask the secrets in the output. Which means if you
38-
# set (for example) EXTENDED_TESTING to 1 then all occurrences of '1'
39-
# are replaced with '*'. (e.g. `s/1/*/g;`). So it's recommended to set
40-
# something that is unlikely to occur in the job(/build/test) output
41-
# (for example: '111111111111111111', 'Rumpelstiltskin', ...).
42-
#
4336
# Example: if you only want to run tests on cygwin then you can set:
44-
# - EXTENDED_TESTING=00000000000000000000000000000000000000
45-
# - CI_SKIP_SANITY=1111111111111111111111111111111111111111
46-
# - CI_FORCE_CYGWIN=111111111111111111111111111111111111111
47-
# - (and all other CI_FORCE_... secrets to 0000000000000000)
37+
# - DO_EXTENDED_TESTING=0
38+
# - CI_SKIP_SANITY=1
39+
# - CI_FORCE_CYGWIN=1
40+
# - (and all other CI_FORCE_... vars to 0)
4841
#
4942

5043
name: testsuite
@@ -117,13 +110,23 @@ jobs:
117110
# "linux-i386" tests -Uusethreads without -DDEBUGGING
118111
# All builds in the "linux" matrix test with -DDEBUGGING
119112
#
120-
# "sanity_check" sets `fetch-depth: 0` so that it does a git clone with full
121-
# history, and hence can run t/porting/cmp_version.t etc
122-
# The git-related tests require full history, but we only need to run them
123-
# once (they aren't platform specific).
124-
# Hence leave the others with the default setting (1), which performs a
125-
# shallow clone. In these shallow checkouts, the git related porting tests
126-
# skip (or rapidly pass), but they won't fail spuriously.
113+
# "sanity_check" sets `fetch-depth: 0` so that it does a git clone
114+
# with full history, and hence can run t/porting/cmp_version.t etc
115+
#
116+
# The git-related tests require full history, but we only need to run
117+
# them once (they aren't platform specific). Hence leave the others
118+
# with the default setting (1), which performs a shallow clone. In
119+
# these shallow checkouts, the git related porting tests skip (or
120+
# rapidly pass), but they won't fail spuriously.
121+
#
122+
# TODO - Now that we do not use secrets and instead use vars for the
123+
# control of which tests we run (due to the way secrets are elided
124+
# from the output), we can simplify the shell code below. The
125+
# following url includes discussion on what next steps we could take
126+
# to simplify the complexity of this code.
127+
#
128+
# https://github.com/Perl/perl5/pull/20845#issuecomment-1440676127
129+
#
127130
128131
sanity_check:
129132
name: "Sanity: Linux -Dusethreads"
@@ -152,18 +155,18 @@ jobs:
152155
- name: Check what-to-do
153156
id: ci_config
154157
env:
155-
CI_SKIP_SANITY: ${{ secrets.CI_SKIP_SANITY }}
156-
CI_FORCE_LINUX: ${{ secrets.CI_FORCE_LINUX }}
157-
CI_FORCE_LINUX_I386: ${{ secrets.CI_FORCE_LINUX_I386 }}
158-
CI_FORCE_INSTALL: ${{ secrets.CI_FORCE_INSTALL }}
159-
CI_FORCE_MACOS: ${{ secrets.CI_FORCE_MACOS }}
160-
CI_FORCE_MSVC142: ${{ secrets.CI_FORCE_MSVC142 }}
161-
CI_FORCE_MINGW64: ${{ secrets.CI_FORCE_MINGW64 }}
162-
CI_FORCE_CYGWIN: ${{ secrets.CI_FORCE_CYGWIN }}
163-
CI_FORCE_MINITEST: ${{ secrets.CI_FORCE_MINITEST }}
164-
CI_FORCE_ASAN: ${{ secrets.CI_FORCE_ASAN }}
165-
CI_FORCE_PERL_UNICODE: ${{ secrets.CI_FORCE_PERL_UNICODE }}
166-
CI_FORCE_DIST_MODULES: ${{ secrets.CI_FORCE_DIST_MODULES }}
158+
CI_SKIP_SANITY: ${{ vars.CI_SKIP_SANITY }}
159+
CI_FORCE_LINUX: ${{ vars.CI_FORCE_LINUX }}
160+
CI_FORCE_LINUX_I386: ${{ vars.CI_FORCE_LINUX_I386 }}
161+
CI_FORCE_INSTALL: ${{ vars.CI_FORCE_INSTALL }}
162+
CI_FORCE_MACOS: ${{ vars.CI_FORCE_MACOS }}
163+
CI_FORCE_MSVC142: ${{ vars.CI_FORCE_MSVC142 }}
164+
CI_FORCE_MINGW64: ${{ vars.CI_FORCE_MINGW64 }}
165+
CI_FORCE_CYGWIN: ${{ vars.CI_FORCE_CYGWIN }}
166+
CI_FORCE_MINITEST: ${{ vars.CI_FORCE_MINITEST }}
167+
CI_FORCE_ASAN: ${{ vars.CI_FORCE_ASAN }}
168+
CI_FORCE_PERL_UNICODE: ${{ vars.CI_FORCE_PERL_UNICODE }}
169+
CI_FORCE_DIST_MODULES: ${{ vars.CI_FORCE_DIST_MODULES }}
167170
run: |
168171
echo '::echo::on'
169172
[[ -n "${CI_SKIP_SANITY}" ]] && [[ "${CI_SKIP_SANITY%[!0 ]*}" != "${CI_SKIP_SANITY}" ]] && echo "ci_skip_sanity=true" >> "$GITHUB_OUTPUT"
@@ -214,16 +217,16 @@ jobs:
214217
TEST_JOBS=2 ./perl t/harness -nre='^porting/'
215218
216219
# Set a variable for dependent jobs to signal if full testsuite is enabled
217-
- name: "Check if EXTENDED_TESTING is set"
220+
- name: "Check if DO_EXTENDED_TESTING is set"
218221
id: check_extended_testing
219222
env:
220-
EXTENDED_TESTING: ${{ secrets.EXTENDED_TESTING }}
223+
DO_EXTENDED_TESTING: ${{ vars.DO_EXTENDED_TESTING }}
221224
CURRENT_REPOSITORY: ${{ github.repository }}
222225
run: |
223226
if [[ "${CURRENT_REPOSITORY}" = 'Perl/perl5' ]]; then
224227
echo "Running all test jobs"
225228
echo "run_all_jobs=true" >> "$GITHUB_OUTPUT"
226-
elif [[ -n "${EXTENDED_TESTING}" ]] && [[ "${EXTENDED_TESTING%[!0 ]*}" != "${EXTENDED_TESTING}" ]]; then
229+
elif [[ -n "${DO_EXTENDED_TESTING}" ]] && [[ "${DO_EXTENDED_TESTING%[!0 ]*}" != "${DO_EXTENDED_TESTING}" ]]; then
227230
echo "Running all test jobs"
228231
echo "run_all_jobs=true" >> "$GITHUB_OUTPUT"
229232
else

0 commit comments

Comments
 (0)