-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from softwareforgood/test-using-reusable-workflow
Add tests for reusable workflows
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# LICENSE: LGPL-3.0-or-later | ||
name: "Reusable workflow that tests whether the check artifact works when called from another workflow" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
type: string | ||
required: true | ||
description: the artifact name to be checked for | ||
|
||
jobs: | ||
sets_false_on_missing: | ||
name: Sets false when no artifact for the name exists | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./ | ||
with: | ||
name: 'missing-dependency' | ||
id: "existence-check" | ||
- name: Fail when expected output isn't set | ||
run: | | ||
exit 1 | ||
if: ${{ steps.existence-check.outputs.exists != 'false' }} | ||
sets_true_when_there: | ||
name: Sets true when artifact for the name exists | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./ | ||
with: | ||
name: ${{inputs.name}} | ||
id: "existence-check" | ||
- name: Fail when expected output isn't set | ||
run: | | ||
exit 1 | ||
if: ${{ steps.existence-check.outputs.exists != 'true' }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters