fix(docs): clean up bit #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Coverage and static check test & upload | |
on: [push, pull_request] | |
jobs: | |
test: | |
name: Coverage and static check test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Lua | |
uses: leafo/gh-actions-lua@v9 | |
with: | |
luaVersion: "5.1.5" | |
- name: Setup LuaRocks | |
uses: leafo/gh-actions-luarocks@v4 | |
- name: Setup test tools | |
run: | | |
luarocks install luacheck | |
luarocks install busted | |
luarocks install luacov | |
- name: Check spec and coverage with busted | |
run: | | |
busted | |
luacov | |
- name: Upload coverage to codecov.io | |
uses: codecov/codecov-action@v3.1.1 | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} # not required for public repos | |
files: ./luacov.report.out | |
fail_ci_if_error: false | |
- name: Check static-check with luacheck | |
run: luacheck src spec | |
upload: | |
name: Upload to wiki | |
needs: test | |
if: ${{ github.repository_owner == 'ShinyColorsWiki' && github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[upload]') }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
name: ["CardCode", "PrismCardCode", "Skill"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Upload module to wiki | |
uses: ShinyColorsWiki/github-actions-mediawiki-uploader@v1 | |
with: | |
mediawiki_api_url: "https://shinycolors.wiki/w/api.php" | |
username: ${{ secrets.BOT_USERNAME }} | |
password: ${{ secrets.BOT_PASSWORD }} | |
filepath: ./src/${{ matrix.name }}.lua | |
pagename: 'Module:${{ matrix.name }}' | |
useragent: ${{ secrets.BOT_USERAGENT }} | |
summary: 'Editing {title} page by Github Action. Reference: https://github.com/ShinyColorsWiki/Wiki-Module/commit/{commit}' | |
- name: Upload documentation to wiki | |
uses: ShinyColorsWiki/github-actions-mediawiki-uploader@v1 | |
continue-on-error: true | |
with: | |
mediawiki_api_url: "https://shinycolors.wiki/w/api.php" | |
username: ${{ secrets.BOT_USERNAME }} | |
password: ${{ secrets.BOT_PASSWORD }} | |
filepath: ./doc/${{ matrix.name }}.txt | |
pagename: 'Module:${{ matrix.name }}/doc' | |
useragent: ${{ secrets.BOT_USERAGENT }} | |
summary: 'Editing {title} page by Github Action. Reference: https://github.com/ShinyColorsWiki/Wiki-Module/commit/{commit}' |