File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030
3131 - name : Publish Unit Test Results
3232 uses : EnricoMi/publish-unit-test-result-action@v1
33+ id : test-results
3334 with :
3435 commit : ${{ github.event.workflow_run.head_sha }}
3536 files : " artifacts/**/*.xml"
37+ - name : Set badge color
38+ if : github.ref == 'refs/heads/master'
39+ shell : bash
40+ run : |
41+ case ${{ fromJSON( steps.test-results.outputs.json ).conclusion }} in
42+ success)
43+ echo "BADGE_COLOR=31c653" >> $GITHUB_ENV
44+ ;;
45+ failure)
46+ echo "BADGE_COLOR=800000" >> $GITHUB_ENV
47+ ;;
48+ neutral)
49+ echo "BADGE_COLOR=696969" >> $GITHUB_ENV
50+ ;;
51+ esac
52+
53+ - name : Create badge
54+ if : github.ref == 'refs/heads/master'
55+ uses : emibcn/badge-action@d6f51ff11b5c3382b3b88689ae2d6db22d9737d1
56+ with :
57+ label : Tests
58+ status : ' ${{ fromJSON( steps.test-results.outputs.json ).stats.tests }} tests, ${{ fromJSON( steps.test-results.outputs.json ).stats.runs }} runs: ${{ fromJSON( steps.test-results.outputs.json ).conclusion }}'
59+ color : ${{ env.BADGE_COLOR }}
60+ path : badge.svg
3661
62+ - name : Upload badge to Gist
63+ if : github.ref == 'refs/heads/master'
64+ uses : andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d
65+ with :
66+ token : ${{ secrets.GIST_TOKEN }}
67+ gistURL : https://gist.githubusercontent.com/eclipse-platform/eclipse.platform.swt/
68+ file : test_results_badge.svg
You can’t perform that action at this time.
0 commit comments