forked from go-gorm/sqlite
-
Notifications
You must be signed in to change notification settings - Fork 43
52 lines (47 loc) · 1.68 KB
/
badge-gorm-tests.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
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Badge GORM tests
on:
workflow_dispatch:
workflow_run:
workflows: ["GORM-tests"]
branches: [master]
types: [completed]
jobs:
create-gorm-tests-badge:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: gorm-tests.yml
workflow_conclusion: completed
path: .
- name: Prepare badge data
working-directory: Linux-1.19-tests.out
run: |
echo "tests_passed=$(cat ./*.out | grep PASS | wc -l)" >> $GITHUB_ENV
echo "tests_skipped=$(cat ./*.out | grep SKIP | wc -l)" >> $GITHUB_ENV
echo "tests_failed=$(cat ./*.out | grep FAIL | wc -l)" >> $GITHUB_ENV
- name: Make success badge
if: ${{ env.tests_failed == '0' }}
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: fb4d23f63d866b3e1e58b26d2f5ed01f
filename: badge-gorm-tests.json
label: GORM tests
message: "Passed: ${{ env.tests_passed }} | Failed: ${{ env.tests_failed }}"
color: 54a158
style: for-the-badge
labelColor: 25292d
- name: Make fail badge
if: ${{ env.tests_failed != '0' }}
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: fb4d23f63d866b3e1e58b26d2f5ed01f
filename: badge-gorm-tests.json
label: GORM tests
message: "Passed: ${{ env.tests_passed }} | Failed: ${{ env.tests_failed }}"
color: 96232b
style: for-the-badge
labelColor: 25292d