@@ -33,35 +33,26 @@ outputs:
3333 # Generated or supplied badge properties
3434 badge-name :
3535 description : " Code coverage badge name waiting for issues/#1"
36- value : ${{ steps.badge-wrapper-actions-issue-1.outputs.badge-name }}
3736 badge-label :
3837 description : " Code coverage badge label waiting for issues/#1"
39- value : ${{ steps.badge-wrapper-actions-issue-1.outputs.badge-label }}
4038 badge-status :
4139 description : " Code coverage badge status waiting for issues/#1"
42- value : " ${{ steps.mineunit-coverage.outputs.total }} in ${{ steps.mineunit-coverage.outputs.files }} files"
4340 badge-color :
4441 description : " Code coverage badge color waiting for issues/#1"
45- value : ${{ steps.badge-wrapper-actions-issue-1.outputs.badge-color }}
4642
4743 # Mineunit test framework output
4844 mineunit-stdout :
4945 description : " Stdout produced during busted run"
50- value : ${{ steps.mineunit-tests.outputs.stdout }}
5146 mineunit-spec-missing :
5247 description : " Set to true if no spec files found for busted"
53- value : ${{ steps.mineunit-tests.outputs.spec-missing }}
5448
5549 mineunit-report :
5650 description : " Mineunit detailed test report"
57- value : ${{ steps.mineunit-report.outputs.report }}
5851
5952 coverage-total :
6053 description : " Total test coverage percentage"
61- value : ${{ steps.mineunit-coverage.outputs.total }}
6254 coverage-files :
6355 description : " Number of files tested and total number of source files"
64- value : ${{ steps.mineunit-coverage.outputs.files }}
6556
6657 # Help content / on demand documentation
6758 help-busted-spec-missing :
@@ -79,49 +70,5 @@ outputs:
7970 ```
8071
8172runs :
82- using : composite
83- steps :
84- - name : install mineunit
85- shell : bash
86- run : |
87- sudo apt-get install -y luarocks > /dev/null
88- luarocks install --server=https://luarocks.org/dev --local mineunit ${{ inputs.mineunit-version }}
89- - id : mineunit-tests
90- name : mineunit runner
91- working-directory : " ${{ inputs.working-directory }}"
92- shell : bash
93- run : |
94- set +eo pipefail
95- exec 3>&1
96- OUT="$($HOME/.luarocks/bin/mineunit -c ${{ inputs.mineunit-args }} | tee >(cat - >&3); exit ${PIPESTATUS[0]})"
97- ERR=$?
98- exec 3>&-
99- grep_eronly=(grep '0 successes / 0 failures / [1-9] error.\? / 0 pending')
100- grep_nospec=(grep 'No test files found')
101- ("${grep_eronly[@]}"<<<"$OUT" && "${grep_nospec[@]}"<<<"$OUT")&>/dev/null && echo "spec-missing=true" >> $GITHUB_OUTPUT
102- OUT="$(sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g'<<<"$OUT")"
103- printf 'stdout<<END-OF-MINEUNIT-CONTENT\n%s\nEND-OF-MINEUNIT-CONTENT' "${OUT}" >> $GITHUB_OUTPUT
104- exit $ERR
105- - id : mineunit-report
106- name : mineunit coverage report
107- working-directory : " ${{ inputs.working-directory }}"
108- shell : bash
109- run : |
110- $HOME/.luarocks/bin/mineunit -r
111- OUT="$(awk -v p=0 '/^----/{p++;next}p==2{exit}p' luacov.report.out | sort -hrk4)"
112- printf 'report<<END-OF-MINEUNIT-CONTENT\n%s\nEND-OF-MINEUNIT-CONTENT' "${OUT}" >> $GITHUB_OUTPUT
113- - id : mineunit-coverage
114- name : collect coverage data
115- working-directory : " ${{ inputs.working-directory }}"
116- shell : bash
117- run : |
118- echo "total=$(tail -n 2 luacov.report.out | grep ^Total | grep -o '[0-9.]\+%$')" >> $GITHUB_OUTPUT
119- awk -v p=0 '/^----/{p++;next}p==2{exit}p' luacov.report.out | sort -hrk4 > luacov.report.sum
120- echo "files=$(grep -cv '\s0\.00%' luacov.report.sum)/$(wc -l<luacov.report.sum)" >> $GITHUB_OUTPUT
121- - id : badge-wrapper-actions-issue-1
122- name : Input wrapper while waiting for actions in actions feature
123- shell : bash
124- run : |
125- echo "badge-name=${{ inputs.badge-name }}" >> $GITHUB_OUTPUT
126- echo "badge-label=${{ inputs.badge-label }}" >> $GITHUB_OUTPUT
127- echo "badge-color=${{ inputs.badge-color }}" >> $GITHUB_OUTPUT
73+ using : docker
74+ image : Dockerfile
0 commit comments