Skip to content

Commit 3b8ab07

Browse files
committed
add: GitHub workflows for testing and releasing
1 parent 8dfa800 commit 3b8ab07

File tree

3 files changed

+76
-2
lines changed

3 files changed

+76
-2
lines changed

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Lua
18+
uses: leafo/gh-actions-lua@v11
19+
with:
20+
luaVersion: "5.4.8"
21+
22+
- name: Set up LuaRocks
23+
uses: leafo/gh-actions-luarocks@v5
24+
25+
- name: Pack Rock
26+
run: luarocks pack
27+
28+
- name: Publish to LuaRocks
29+
run: luarocks upload --api-key=${{ secrets.LUAROCKS_API_KEY } *.rockspec
30+
31+
- name: Create GitHub Release
32+
uses: softprops/action-gh-release@v2
33+
with:
34+
files: *.src.rock

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Lua
17+
uses: leafo/gh-actions-lua@v11
18+
with:
19+
luaVersion: "5.4.8"
20+
21+
- name: Set up LuaRocks
22+
uses: leafo/gh-actions-luarocks@v5
23+
24+
- name: Install LuaCov
25+
run: luarocks install LuaCov
26+
27+
- name: Run Test Suite
28+
run: luarocks test -- -c -o TAP
29+
30+
- name: Upload Coverage Report
31+
uses: actions/[email protected]
32+
with:
33+
name: luacov-report-${{ github.sha }}.html
34+
path: ./luacov.report.html

.vscode/settings.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,11 @@
33
"editor.insertSpaces": false,
44
"editor.tabSize": 4,
55
"prettier.tabWidth": 4,
6-
"prettier.useTabs": true
7-
}
6+
"prettier.useTabs": true,
7+
"[yaml]": {
8+
"editor.insertSpaces": true,
9+
"editor.tabSize": 2,
10+
"prettier.tabWidth": 2,
11+
"prettier.useTabs": false,
12+
}
13+
}

0 commit comments

Comments
 (0)