Skip to content

Commit

Permalink
feat: more debugging, version printing (#68)
Browse files Browse the repository at this point in the history
Signed-off-by: William Woodruff <[email protected]>
  • Loading branch information
woodruffw authored Aug 8, 2023
1 parent 1e232a0 commit d48c9cd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/selftest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
id: sigstore-python
with:
inputs: ./test/artifact.txt
internal-be-careful-debug: true
- name: Check outputs
shell: bash
run: |
Expand All @@ -55,6 +56,7 @@ jobs:
id: sigstore-python
with:
inputs: ${{ matrix.input }}
internal-be-careful-debug: true
- name: Check failure
env:
XFAIL: ${{ steps.sigstore-python.outcome == 'failure' }}
Expand All @@ -75,6 +77,7 @@ jobs:
with:
inputs: ./test/artifact.txt
staging: true
internal-be-careful-debug: true
- name: Check outputs
run: |
[[ -f ./test/artifact.txt.sigstore ]] || exit 1
Expand All @@ -90,6 +93,7 @@ jobs:
with:
inputs: ./test/*.txt
staging: true
internal-be-careful-debug: true

selftest-upload-artifacts:
runs-on: ubuntu-latest
Expand All @@ -103,6 +107,7 @@ jobs:
inputs: ./test/artifact.txt
staging: true
upload-signing-artifacts: true
internal-be-careful-debug: true
- uses: actions/download-artifact@v3
with:
name: "signing-artifacts-${{ github.job }}"
Expand All @@ -127,6 +132,7 @@ jobs:
certificate: ./test/custom_certificate.crt
bundle: ./test/custom_bundle.sigstore
staging: true
internal-be-careful-debug: true
- name: Check outputs
run: |
[[ -f ./test/custom_signature.sig ]] || exit 1
Expand All @@ -147,6 +153,7 @@ jobs:
verify-cert-identity: https://github.com/sigstore/gh-action-sigstore-python/.github/workflows/selftest.yml@${{ github.ref }}
verify-oidc-issuer: https://token.actions.githubusercontent.com
staging: true
internal-be-careful-debug: true

selftest-xfail-verify-missing-options:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -183,6 +190,8 @@ jobs:
verify-oidc-issuer: ${{ matrix.config.verify-oidc-issuer }}
verify-cert-identity: ${{ matrix.config.verify-cert-identity }}
staging: true
internal-be-careful-debug: true

- name: Check failure
env:
XFAIL: ${{ steps.sigstore-python.outcome == 'failure' }}
Expand Down Expand Up @@ -215,6 +224,7 @@ jobs:
inputs: ./test/artifact.txt
identity-token: ${{ steps.get-oidc-token.outputs.identity-token }}
staging: true
internal-be-careful-debug: true

all-selftests-pass:
if: always()
Expand Down
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ runs:
run: |
# NOTE: Sourced, not executed as a script.
source "${GITHUB_ACTION_PATH}/setup/setup.bash"
env:
GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG: "${{ inputs.internal-be-careful-debug }}"
shell: bash

- name: Run sigstore-python
Expand Down
9 changes: 9 additions & 0 deletions setup/setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ die() {
exit 1
}

debug() {
if [[ "${GHA_SIGSTORE_PYTHON_INTERNAL_BE_CAREFUL_DEBUG}" = "true" ]]; then
echo -e "\033[93mDEBUG: ${1}\033[0m"
fi
}

debug "Python: $(python -V)"
debug "pip: $(python -m pip --version)"

# NOTE: This file is meant to be sourced, not executed as a script.
if [[ "${0}" == "${BASH_SOURCE[0]}" ]]; then
die "Internal error: setup harness was executed instead of being sourced?"
Expand Down

0 comments on commit d48c9cd

Please sign in to comment.