aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2025-02-25 01:55:49 +0100
committerGitHub <noreply@github.com>2025-02-25 01:55:49 +0100
commit9de0d9346cf5c17cd4a96c58ad326919bd8d27ed (patch)
tree2e50782f6fc265c6063654df40f54c09a22c1be8
parent0cb19e1617d735e815e9747a53b6d9f3b3bd568b (diff)
downloadluasystem-9de0d9346cf5c17cd4a96c58ad326919bd8d27ed.tar.gz
luasystem-9de0d9346cf5c17cd4a96c58ad326919bd8d27ed.tar.bz2
luasystem-9de0d9346cf5c17cd4a96c58ad326919bd8d27ed.zip
chore(ci): lint GH action workflows (#49)
Co-authored-by: cos <cos>
-rw-r--r--.github/workflows/.yamllint.yaml6
-rw-r--r--.github/workflows/build.yml62
-rw-r--r--.github/workflows/deploy.yml19
-rw-r--r--.github/workflows/luacheck.yml16
4 files changed, 67 insertions, 36 deletions
diff --git a/.github/workflows/.yamllint.yaml b/.github/workflows/.yamllint.yaml
new file mode 100644
index 0000000..2632ac5
--- /dev/null
+++ b/.github/workflows/.yamllint.yaml
@@ -0,0 +1,6 @@
1---
2extends: default
3
4rules:
5 # MSGH Actions has a key called 'on', which causes false positives.
6 truthy: disable
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 7ce2825..55a05f5 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,3 +1,4 @@
1---
1name: "Build" 2name: "Build"
2 3
3concurrency: 4concurrency:
@@ -13,7 +14,7 @@ on:
13 pull_request: {} 14 pull_request: {}
14 push: 15 push:
15 branches: 16 branches:
16 - master 17 - master
17 18
18jobs: 19jobs:
19 test: 20 test:
@@ -22,19 +23,19 @@ jobs:
22 matrix: 23 matrix:
23 os: ['ubuntu-20.04', 'macos-13'] 24 os: ['ubuntu-20.04', 'macos-13']
24 luaVersion: 25 luaVersion:
25 - "5.1" 26 - "5.1"
26 - "5.2" 27 - "5.2"
27 - "5.3" 28 - "5.3"
28 - "5.4" 29 - "5.4"
29 - "luajit" 30 - "luajit"
30 - "luajit-openresty" 31 - "luajit-openresty"
31 include: 32 include:
32 - os: "macos-latest" 33 - os: "macos-latest"
33 luaVersion: "5.4" 34 luaVersion: "5.4"
34 # On Windows builds: 35 # On Windows builds:
35 # 'hishamhm/gh-actions-lua' will build the PuC Rio Lua versions using MSVC, and 36 # 'hishamhm/gh-actions-lua' will build the PuC Rio Lua versions using
36 # the LuaJIT version using MinGW/gcc. By running against both below, we test 37 # MSVC, and the LuaJIT version using MinGW/gcc. By running against
37 # both toolchains. 38 # both below, we test both toolchains.
38 - os: "windows-latest" 39 - os: "windows-latest"
39 toolchain: "msvc" 40 toolchain: "msvc"
40 luaVersion: "5.1" 41 luaVersion: "5.1"
@@ -64,28 +65,31 @@ jobs:
64 uses: ilammy/msvc-dev-cmd@v1 65 uses: ilammy/msvc-dev-cmd@v1
65 66
66 # - name: install Dependencies analyzer 67 # - name: install Dependencies analyzer
67 # # action step used for troubleshooting if Windows dll's build incorrectly 68 # # action step used for troubleshooting if Windows dll's build
68 # run: | 69 # # incorrectly
69 # $version = "1.11.1" 70 # run: "
70 # echo "Installing Dependencies version: $version" 71 # $version = \"1.11.1\"\n
71 # $url = 'https://github.com/lucasg/Dependencies/releases/download/v' + $version + '/Dependencies_x64_Release.zip' 72 # echo \"Installing Dependencies version: $version\"\n
72 # $dest = Join-Path -Path $PWD -ChildPath ".dependencies" 73 # $url = 'https://github.com/lucasg/Dependencies/releases/download/v'
74 # + $version + '/Dependencies_x64_Release.zip'\n
75 # $dest = Join-Path -Path $PWD -ChildPath \".dependencies\"\n
73 76
74 # # Download and extract Dependencies 77 # # Download and extract Dependencies\n
75 # New-Item -ItemType Directory -Path "$dest" 78 # New-Item -ItemType Directory -Path \"$dest\"\n
76 # Invoke-WebRequest -Uri $url -OutFile "$dest\dependencies.zip" 79 # Invoke-WebRequest -Uri $url -OutFile \"$dest\\dependencies.zip\"\n
77 # Expand-Archive -Path "$dest\dependencies.zip" -DestinationPath "$dest" 80 # Expand-Archive -Path \"$dest\\dependencies.zip\" -DestinationPath
78 # Remove-Item -Path "$dest\dependencies.zip" 81 # \"$dest\"\n
79 # # dir "$dest" 82 # Remove-Item -Path \"$dest\\dependencies.zip\"\n
83 # # dir \"$dest\"\n
80 84
81 # # Add Dependencies to PATH 85 # # Add Dependencies to PATH\n
82 # $env:PATH += ";$dest" 86 # $env:PATH += \";$dest\"\n
83 # echo $env:PATH 87 # echo $env:PATH\n
84 88
85 # # Verify Dependencies Installation 89 # # Verify Dependencies Installation\n
86 # dir "$dest\*.exe" 90 # dir \"$dest\\*.exe\"\n
87 # dir ".\.dependencies\Dependencies.exe" 91 # dir \".\\.dependencies\Dependencies.exe\"\n
88 # .\.dependencies\Dependencies.exe -help 92 # .\\.dependencies\\Dependencies.exe -help\n
89 93
90 - uses: hishamhm/gh-actions-lua@master 94 - uses: hishamhm/gh-actions-lua@master
91 with: 95 with:
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index cd31c47..19192f5 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -1,11 +1,13 @@
1---
1name: Deploy 2name: Deploy
2 3
3on: [ push, workflow_dispatch ] 4on: [push, workflow_dispatch]
4 5
5jobs: 6jobs:
6 7
7 affected: 8 affected:
8 uses: lunarmodules/.github/.github/workflows/list_affected_rockspecs.yml@main 9 uses:
10 lunarmodules/.github/.github/workflows/list_affected_rockspecs.yml@main
9 11
10 build: 12 build:
11 needs: affected 13 needs: affected
@@ -15,16 +17,19 @@ jobs:
15 rockspecs: ${{ needs.affected.outputs.rockspecs }} 17 rockspecs: ${{ needs.affected.outputs.rockspecs }}
16 18
17 upload: 19 upload:
18 needs: [ affected, build ] 20 needs: [affected, build]
19 # Only run upload if: 21 # Only run upload if:
20 # 1. We are on the canonical repository (no uploads from forks) 22 # 1. We are on the canonical repository (no uploads from forks)
21 # 2. The current commit is either tagged or on the default branch (the workflow will upload dev/scm rockspecs any 23 # 2. The current commit is either tagged or on the default branch (the
22 # time they are touched, tagged ones whenever the edited rockspec and tag match) 24 # workflow will upload dev/scm rockspecs any time they are touched,
23 # 3. Some rockspecs were changed — this implies the commit changing the rockspec is the same one that gets tagged 25 # tagged ones whenever the edited rockspec and tag match)
26 # 3. Some rockspecs were changed — this implies the commit changing the
27 # rockspec is the same one that gets tagged
24 if: >- 28 if: >-
25 ${{ 29 ${{
26 github.repository == 'lunarmodules/luasystem' && 30 github.repository == 'lunarmodules/luasystem' &&
27 ( github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/') ) && 31 ( github.ref_name == 'master' ||
32 startsWith(github.ref, 'refs/tags/') ) &&
28 needs.affected.outputs.rockspecs 33 needs.affected.outputs.rockspecs
29 }} 34 }}
30 uses: lunarmodules/.github/.github/workflows/upload_to_luarocks.yml@main 35 uses: lunarmodules/.github/.github/workflows/upload_to_luarocks.yml@main
diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml
index 9cb784c..b268e4f 100644
--- a/.github/workflows/luacheck.yml
+++ b/.github/workflows/luacheck.yml
@@ -1,3 +1,4 @@
1---
1name: Luacheck 2name: Luacheck
2 3
3on: [push, pull_request] 4on: [push, pull_request]
@@ -11,3 +12,18 @@ jobs:
11 uses: actions/checkout@v4 12 uses: actions/checkout@v4
12 - name: Luacheck 13 - name: Luacheck
13 uses: lunarmodules/luacheck@v1 14 uses: lunarmodules/luacheck@v1
15
16 yamllint:
17 name: Run yamllint
18 runs-on: ubuntu-latest
19
20 steps:
21 - name: Checkout repository
22 uses: actions/checkout@v4
23 - name: Set up Python
24 uses: actions/setup-python@v5
25 - name: Install yamllint
26 run: pip install yamllint
27 - name: Run yamllint
28 run: |
29 yamllint -c .github/workflows/.yamllint.yaml .