-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (36 loc) · 1.12 KB
/
_internal_lint_failure.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# This workflow calls the reusable test workflow and ensures that the
# tests do not pass.
#
# Please don't use this as a reusable workflow, because it is very
# much not.
name: Internal job invocation that expects a lint failure result
on:
workflow_call:
inputs:
root:
description: "Directory containing the go.mod of the codebase under test"
type: string
default: "."
failing_job:
description: "Job that is intended to fail"
type: "string"
jobs:
lints:
uses: "./.github/workflows/lints.yml"
with:
root: ${{inputs.root}}
_internal_continue_on_error: ${{inputs.failing_job}}
expect_lint_failure:
runs-on: ubuntu-latest
needs: lints
steps:
- name: transform expected failure
id: expected_failure
env:
NEEDS_JSON: ${{toJSON(needs)}}
NEEDS_OUTPUT: ${{fromJSON(needs.lints.outputs._internal_lint_result)[inputs.failing_job]}}
run: >
echo "status=$NEEDS_OUTPUT" | tee -a $GITHUB_OUTPUT
- name: expect failure
run: exit 1
if: steps.expected_failure.outputs.status != 'failure'