-
-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Composite actions for badging (#196)
* Improved badging actions use new composite if feature to perform more heavy lifting (making the workflows more DRY) * only make badges on push * update ssl traits * replace success/failure with generic write
- Loading branch information
1 parent
5c9787e
commit 8254f7c
Showing
8 changed files
with
68 additions
and
121 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 |
---|---|---|
@@ -1,24 +1,32 @@ | ||
name: Make a Badge | ||
description: Creates a JSON file for use with Sheilds.io. The default is a "brightgreen" "Passing" badge | ||
name: Regular badging sequence | ||
description: Publishes a badge based on the job status | ||
inputs: | ||
category: | ||
description: The subfolder where to group the badges | ||
required: true | ||
label: | ||
description: The label to you in the badge (this should be unqie for each badge in a category) | ||
required: true | ||
message: | ||
description: The message you wish to have in the badge | ||
github_token: | ||
description: The token to use to publish the changes | ||
required: false | ||
default: "Passing" | ||
color: | ||
description: The color you wish the badge to be | ||
required: false | ||
default: "brightgreen" | ||
default: ${{ github.token }} | ||
runs: | ||
using: composite | ||
steps: | ||
- run: | | ||
mkdir -p badges/${{ inputs.category }}/${{ inputs.label }} | ||
echo '{ "schemaVersion": 1, "label": "${{ inputs.label }}", "message": "${{ inputs.message }}", "color": "${{ inputs.color }}" }' > badges/${{ inputs.category }}/${{ inputs.label }}/shields.json | ||
shell: bash | ||
- if: success() | ||
uses: ./.github/actions/badge/write | ||
with: | ||
category: ${{ inputs.category }} | ||
label: ${{ inputs.label }} | ||
- if: | | ||
!success() | ||
uses: ./.github/actions/badge/write | ||
with: | ||
category: ${{ inputs.category }} | ||
label: ${{ inputs.label }} | ||
message: Failing | ||
color: red | ||
- uses: ./.github/actions/badge/publish | ||
with: | ||
github_token: ${{ inputs.github_token }} |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
name: Make a Badge | ||
description: Creates a JSON file for use with Sheilds.io. The default is a "brightgreen" "Passing" badge | ||
inputs: | ||
category: | ||
description: The subfolder where to group the badges | ||
required: true | ||
label: | ||
description: The label to you in the badge (this should be unqie for each badge in a category) | ||
required: true | ||
message: | ||
description: The message you wish to have in the badge | ||
required: false | ||
default: "Passing" | ||
color: | ||
description: The color you wish the badge to be | ||
required: false | ||
default: "brightgreen" | ||
runs: | ||
using: composite | ||
steps: | ||
- run: | | ||
mkdir -p badges/${{ inputs.category }}/${{ inputs.label }} | ||
echo '{ "schemaVersion": 1, "label": "${{ inputs.label }}", "message": "${{ inputs.message }}", "color": "${{ inputs.color }}" }' > badges/${{ inputs.category }}/${{ inputs.label }}/shields.json | ||
shell: bash |
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 |
---|---|---|
|
@@ -20,45 +20,35 @@ jobs: | |
run: cp /usr/local/opt/[email protected]/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/ | ||
|
||
- uses: actions/checkout@v2 | ||
- run: cmake -E make_directory ${{github.workspace}}/build | ||
- run: cmake -E make_directory ${{ github.workspace }}/build | ||
|
||
- name: configure | ||
shell: bash # access regardless of the host operating system | ||
working-directory: ${{github.workspace}}/build | ||
working-directory: ${{ github.workspace }}/build | ||
run: cmake $GITHUB_WORKSPACE -DJWT_BUILD_EXAMPLES=ON | ||
|
||
- name: build | ||
working-directory: ${{github.workspace}}/build | ||
working-directory: ${{ github.workspace }}/build | ||
shell: bash | ||
run: cmake --build . | ||
|
||
- if: matrix.os != 'windows-latest' | ||
name: test | ||
working-directory: ${{github.workspace}}/build | ||
working-directory: ${{ github.workspace }}/build | ||
shell: bash | ||
run: | | ||
./example/rsa-create | ||
./example/rsa-verify | ||
- if: matrix.os == 'windows-latest' | ||
name: test | ||
working-directory: ${{github.workspace}}/build | ||
working-directory: ${{ github.workspace }}/build | ||
run: | | ||
example\Debug\rsa-create.exe | ||
example\Debug\rsa-verify.exe | ||
- name: badge success | ||
if: github.event_name == 'push' && success() | ||
uses: ./.github/actions/badge/success | ||
- if: github.event_name == 'push' && always() | ||
uses: ./.github/actions/badge | ||
with: | ||
category: cross-platform | ||
label: ${{ matrix.os }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: badge failure | ||
if: github.event_name == 'push' && !success() | ||
uses: ./.github/actions/badge/failure | ||
with: | ||
category: cross-platform | ||
label: ${{ matrix.os }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
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
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