Skip to content

Commit 6a002ec

Browse files
authored
workflows/selftest: add more xfail selftests (#38)
Signed-off-by: William Woodruff <[email protected]> Signed-off-by: William Woodruff <[email protected]>
1 parent 7a26f57 commit 6a002ec

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/selftest.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,33 @@ jobs:
2222
with:
2323
inputs: ./test/artifact.txt
2424

25+
selftest-xfail-invalid-inputs:
26+
runs-on: ubuntu-latest
27+
strategy:
28+
matrix:
29+
input:
30+
# We forbid inputs that look like flags
31+
- "--this-should-not-work"
32+
# We fail if the input doesn't exist
33+
- "/tmp/extremely-nonexistent-file"
34+
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
35+
steps:
36+
- uses: actions/checkout@v3
37+
- name: Sign artifact and publish signature
38+
continue-on-error: true
39+
uses: ./
40+
id: sigstore-python
41+
with:
42+
inputs: ${{ matrix.input }}
43+
- name: Check failure
44+
env:
45+
XFAIL: ${{ steps.sigstore-python.outcome == 'failure' }}
46+
JOB_NAME: ${{ github.job }}
47+
run: |
48+
echo "xfail ${JOB_NAME}: ${XFAIL}"
49+
50+
[[ "${XFAIL}" == "true" ]] || { >&2 echo "expected step to fail"; exit 1; }
51+
2552
selftest-staging:
2653
runs-on: ubuntu-latest
2754
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork

0 commit comments

Comments
 (0)