Skip to content

Commit

Permalink
ci: check composit action
Browse files Browse the repository at this point in the history
  • Loading branch information
greenkiwi committed Jun 18, 2022
1 parent a610f9a commit df2f863
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/check-needs/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check needs
description: Checks required jobs to see if they all passed
inputs:
failed-dependencies:
description: pass in the following "{{ contains(needs.*.result, 'failure') }}"
required: true

runs:
using: composite
steps:
- name: Test
run: |
echo FAILED_DEPENDENCY=${{ inputs.failed-dependencies }}
[[ ${{ inputs.failed-dependencies }} = true ]] && exit 1 || echo "Test executed"
shell: bash
- run: echo "success"
shell: bash
- name : machine echo job
env : { CONTENT : "${{ toJson(job) }}" }
run : "echo $CONTENT"
shell: bash
- name : machine echo env
env : { CONTENT : "${{ toJson(env) }}" }
run : "echo $CONTENT"
shell: bash
- name : machine echo github
env : { CONTENT : "${{ toJson(github) }}" }
run : "echo $CONTENT"
shell: bash
17 changes: 16 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: echo "fail 3"
# - run: exit 1
- run: exit 1


Test:
Expand All @@ -43,3 +43,18 @@ jobs:
env:
FAILED_DEPENDENCY: ${{ contains(needs.*.result, 'failure') }}
- run: echo "success"


Test2:
name: Test 2
if: always()
runs-on: ubuntu-latest
needs:
- test-1
- test-2
- test-3
steps:
- uses: actions/checkout@v3
- uses: ./.github/check-needs
with:
failed-dependencies: ${{ contains(needs.*.result, 'failure') }}

0 comments on commit df2f863

Please sign in to comment.