-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (64 loc) · 2.5 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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}'