Skip to content

Commit

Permalink
tests: add env var IS_STEP_DEBUG to conditionally run debug prints
Browse files Browse the repository at this point in the history
Currently we just uncomment debug prints, but GitHub actions actually
has the option to debug the runs, which sets a secret called
`secrets.ACTIONS_STEP_DEBUG`. We can not directly access this in the
jobs so we need to turn it into an envirionment variable.

This way we can add an `if` condition to debug steps to skip them when
we're not debugging the run:

`if: ${{ env.IS_STEP_DEBUG == 'true' }}`

Signed-off-by: Axel Gembe <[email protected]>
  • Loading branch information
EchterAgo authored and andrewc12 committed Oct 20, 2023
1 parent 97ff2aa commit ac56c30
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/windows-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
IS_STEP_DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }}

jobs:
build_windows:
Expand All @@ -41,6 +42,7 @@ jobs:

- name: debug - git status
run: git status
if: ${{ env.IS_STEP_DEBUG == 'true' }}

#https://stackoverflow.com/a/60883893
# "C:\Program Files\Git\bin\git.exe" -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +90acd8f20e6d0c14b83241cc7dcd17df27d5a95b:refs/remotes/origin/andrew_workflows-7
Expand Down Expand Up @@ -159,6 +161,7 @@ jobs:

- name: debug - print log
run: cat "${{github.workspace}}\InnoSetup-Install.log"
if: ${{ env.IS_STEP_DEBUG == 'true' }}

- name: Check InstallLocation Registry Value
run: |
Expand Down

0 comments on commit ac56c30

Please sign in to comment.