Skip to content

mirin.node and mirin.defineMod support optional output and opts #52

mirin.node and mirin.defineMod support optional output and opts

mirin.node and mirin.defineMod support optional output and opts #52

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: busted
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
if: ${{ ( github.event_name == 'pull_request' && github.actor == github.repository_owner ) || github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: leafo/gh-actions-lua@v9.1.0
with:
luaVersion: "5.1"
- uses: leafo/gh-actions-luarocks@v4
- name: Prepare dependencies
id: setup
run: |
luarocks install busted
luarocks install cluacov
luarocks install luacheck
# install stylua
- uses: JohnnyMorganz/stylua-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --version
- name: Run Tests with busted
id: test
run: |
make test
- name: Check Test Coverage with luacov
id: coverage
run: |
make coverage
# Switch to badges to push
- uses: actions/checkout@v3
with:
ref: badges
- name: Generate coverage badge
uses: emibcn/badge-action@v1
id: badge
with:
label: "luacov"
status: ${{ steps.coverage.outputs.coverage }}%
color: ${{
steps.coverage.outputs.coverage > 90 && 'green' ||
steps.coverage.outputs.coverage > 80 && 'yellow,green' ||
steps.coverage.outputs.coverage > 70 && 'yellow' ||
steps.coverage.outputs.coverage > 60 && 'orange,yellow' ||
steps.coverage.outputs.coverage > 50 && 'orange' ||
steps.coverage.outputs.coverage > 40 && 'red,orange' ||
steps.coverage.outputs.coverage > 30 && 'red,red,orange' ||
steps.coverage.outputs.coverage > 20 && 'red,red,red,orange' ||
'red' }}
path: "coverage.svg"
- name: Upload coverage badge
id: commit
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add "coverage.svg"
# ignore if the command fails due to file not changing
git commit -m "Add/Update badge" || true
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: badges