Skip to content

Commit

Permalink
Mineunit update (#100)
Browse files Browse the repository at this point in the history
* Mineunit update

* Add detailed report as commit comments

* Coverage report headers, post only for PRs, replace previous comments

* Badge updates only after merged to master

* Single comment for coverage report

* Hide coverage report details and make first line generic

Co-authored-by: SX <sx@minetest>
  • Loading branch information
S-S-X and SX committed Mar 1, 2021
1 parent 68849ca commit e4c01de
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 6 deletions.
36 changes: 31 additions & 5 deletions .github/workflows/busted.yml → .github/workflows/mineunit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: busted
name: mineunit

on: [push, pull_request]

Expand All @@ -16,6 +16,7 @@ jobs:
badge-name: metatool-coverage
badge-label: Metatool API Coverage
- uses: RubbaBoy/BYOB@v1.2.0
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master'
with:
NAME: "${{ steps.mineunit-metatool.outputs.badge-name }}"
LABEL: "${{ steps.mineunit-metatool.outputs.badge-label }}"
Expand All @@ -27,11 +28,10 @@ jobs:
uses: mt-mods/mineunit-actions@master
with:
working-directory: ./containertool
mineunit-directory: ../metatool/spec/mineunit
luacov-exclude: '["../metatool/"]'
badge-name: containertool-coverage
badge-label: Containertool Coverage
- uses: RubbaBoy/BYOB@v1.2.0
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master'
with:
NAME: "${{ steps.mineunit-containertool.outputs.badge-name }}"
LABEL: "${{ steps.mineunit-containertool.outputs.badge-label }}"
Expand All @@ -43,14 +43,40 @@ jobs:
uses: mt-mods/mineunit-actions@master
with:
working-directory: ./sharetool
mineunit-directory: ../metatool/spec/mineunit
luacov-exclude: '["../metatool/"]'
badge-name: sharetool-coverage
badge-label: Sharetool Coverage
- uses: RubbaBoy/BYOB@v1.2.0
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master'
with:
NAME: "${{ steps.mineunit-sharetool.outputs.badge-name }}"
LABEL: "${{ steps.mineunit-sharetool.outputs.badge-label }}"
STATUS: "${{ steps.mineunit-sharetool.outputs.badge-status }}"
COLOR: "${{ steps.mineunit-sharetool.outputs.badge-color }}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- if: success() && github.event_name == 'pull_request'
uses: KeisukeYamashita/create-comment@v1
with:
check-only-first-line: true
comment: |
<details><summary><i>Click for detailed source code test coverage report</i></summary>
### Test coverage report for Metatool API sources:
```
File Hits Missed Coverage
-----------------------------------------------------
${{ steps.mineunit-metatool.outputs.mineunit-report }}
```
### Test coverage report for Containertool sources:
```
File Hits Missed Coverage
-----------------------------------------------------
${{ steps.mineunit-containertool.outputs.mineunit-report }}
```
### Test coverage report for Sharetool sources:
```
File Hits Missed Coverage
-----------------------------------------------------
${{ steps.mineunit-sharetool.outputs.mineunit-report }}
```
</details>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![luacheck](https://github.com/S-S-X/metatool/workflows/luacheck/badge.svg)
![busted](https://github.com/S-S-X/metatool/workflows/busted/badge.svg)
![mineunit](https://github.com/S-S-X/metatool/workflows/mineunit/badge.svg)

![](https://byob.yarr.is/S-S-X/metatool/metatool-coverage)
![](https://byob.yarr.is/S-S-X/metatool/sharetool-coverage)
Expand Down
2 changes: 2 additions & 0 deletions containertool/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![](https://byob.yarr.is/S-S-X/metatool/containertool-coverage)

## Container tool basics

Container tool is made available for copying container settings from one node to another.
Expand Down
3 changes: 3 additions & 0 deletions containertool/spec/mineunit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ fixture_paths = {
"spec/fixtures",
"../metatool/spec/fixtures",
}
exclude = {
"../metatool/",
}
7 changes: 7 additions & 0 deletions metatool/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
![](https://byob.yarr.is/S-S-X/metatool/metatool-coverage)

## Metatool basics

Metatool is API used to implement tools.

See other mods in modpack for examples, for example tubetool, sharetool or luatool.
2 changes: 2 additions & 0 deletions sharetool/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![](https://byob.yarr.is/S-S-X/metatool/sharetool-coverage)

## Sharetool basics

Sharetool is moderator tool that can be used to claim ownership of various nodes and
Expand Down
3 changes: 3 additions & 0 deletions sharetool/spec/mineunit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ fixture_paths = {
"spec/fixtures",
"../metatool/spec/fixtures",
}
exclude = {
"../metatool/",
}

0 comments on commit e4c01de

Please sign in to comment.