Repository navigation
125 lines (107 loc) · 3.81 KB
/
Copy pathci.yml
File metadata and controls
125 lines (107 loc) · 3.81 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: CI
# Runs on every push and pull request. Never publishes or uploads anywhere -
# see release.yml for the publish pipeline. This workflow is what branch
# protection should require to pass before merging to master.
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
format:
name: Format check (StyLua)
runs-on: ubuntu-latest
steps:
- name: Clone project
uses: actions/checkout@v4
- name: Check formatting
uses: JohnnyMorganz/stylua-action@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: "2.5.2"
# ChangelogManifest.lua is auto-generated (see
# Tools/generate-changelog-manifest.lua) and excluded here for the
# same reason as in Tools/dev.ps1/Makefile: StyLua's
# AutoPreferDouble quote-style conflicts with the generator's raw
# string.format("%q", ...) output.
args: --check --glob '**/*.lua' --glob '!ChangelogManifest.lua' .
luacheck:
name: Luacheck
runs-on: ubuntu-latest
steps:
- name: Clone project
uses: actions/checkout@v4
- name: Install and run Luacheck
uses: nebularg/actions-luacheck@v1
with:
args: "--no-color -q"
tests:
name: Lua unit tests
runs-on: ubuntu-latest
steps:
- name: Clone project
uses: actions/checkout@v4
- name: Install Lua 5.1
run: sudo apt-get update && sudo apt-get install -y lua5.1
- name: Run unit tests
run: |
set -e
for f in Tests/test_utils.lua Tests/test_config.lua Tests/test_main.lua; do
echo "-- $f --"
lua5.1 "$f"
done
validate:
name: Validate addon (TOC, file structure)
runs-on: ubuntu-latest
steps:
- name: Clone project
uses: actions/checkout@v4
- name: Install Lua 5.1
run: sudo apt-get update && sudo apt-get install -y lua5.1
- name: Validate .toc files
run: lua5.1 Tools/validate-toc.lua
- name: Verify ChangelogManifest.lua is up to date
run: lua5.1 Tools/generate-changelog-manifest.lua --check
build:
name: Build package (no upload)
needs: [format, luacheck, tests, validate]
runs-on: ubuntu-latest
steps:
- name: Clone project
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if commit is a release tag
id: tag_check
run: |
TAG=$(git tag --points-at HEAD)
if [ -n "$TAG" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
echo "HEAD is tagged as '${TAG}' — this is a release commit, skipping dry-run build."
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
# -d skips all uploading (CurseForge/WoWInterface/Wago/GitHub) - this
# only proves the package builds. -p 0 unsets the CurseForge project id
# for this dry run so it doesn't attempt any CurseForge API calls
# (which would need CF_API_KEY, not available to PRs from forks).
- name: Build package artifact
if: steps.tag_check.outputs.skip == 'false'
uses: BigWigsMods/packager@v2.6.1
with:
args: -d -p 0 -w 0 -a 0 -m .pkgmeta
- name: Upload build artifact
if: steps.tag_check.outputs.skip == 'false'
uses: actions/upload-artifact@v7
with:
name: PersonalPlayerNotes-build-${{ github.sha }}
path: .release/*.zip
retention-days: 14
# BigWigsMods/packager writes to a dotdir (.release) by default,
# and upload-artifact excludes hidden files/dirs unless told not to.
include-hidden-files: true
if-no-files-found: error