Skip to content

Commit 882702e

Browse files
authored
fix(ci): fix CI workflow (#333)
Update the CI workflow configuration in .github/workflows/test.yml to enhance compatibility, improve dependency management, and ensure the use of the latest tools. Key changes include upgrading GitHub Actions versions, adding new dependencies, and explicitly installing the latest version of LuaRocks. Also drop a redundant checkout action.
1 parent 1833103 commit 882702e

1 file changed

Lines changed: 24 additions & 7 deletions

File tree

.github/workflows/test.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ jobs:
66
luacheck:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v4
1010
- uses: leafo/gh-actions-lua@v8
1111
with:
1212
luaVersion: "luajit-openresty"
13-
- uses: leafo/gh-actions-luarocks@v4
13+
- uses: leafo/gh-actions-luarocks@v5
14+
with:
15+
luarocksVersion: "3.12.2"
1416
- run: luarocks install luacheck
1517
- run: luacheck lib
1618

@@ -30,17 +32,17 @@ jobs:
3032
options: --init
3133

3234
steps:
33-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v4
3436
- name: Install deps
3537
run: |
36-
apk add --no-cache curl perl bash wget git perl-dev libarchive-tools nodejs
38+
apk add --no-cache curl perl bash wget git perl-dev libarchive-tools nodejs build-base
3739
ln -s /usr/bin/bsdtar /usr/bin/tar
3840
3941
- name: Install CPAN
4042
run: curl -s -L http://xrl.us/cpanm > /bin/cpanm && chmod +x /bin/cpanm
4143

4244
- name: Cache
43-
uses: actions/cache@v2
45+
uses: actions/cache@v3
4446
with:
4547
path: |
4648
~/.cpan
@@ -50,13 +52,28 @@ jobs:
5052
- name: Install Test::Nginx
5153
run: cpanm -q -n Test::Nginx
5254

55+
- name: Install latest LuaRocks
56+
run: |
57+
# Remove old luarocks if exists
58+
rm -rf /usr/local/openresty/luajit/bin/luarocks* || true
59+
# Download and install latest LuaRocks
60+
cd /tmp
61+
wget https://luarocks.org/releases/luarocks-3.12.2.tar.gz
62+
tar zxpf luarocks-3.12.2.tar.gz
63+
cd luarocks-3.12.2
64+
./configure --prefix=/usr/local/openresty/luajit \
65+
--with-lua=/usr/local/openresty/luajit \
66+
--lua-suffix=jit \
67+
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
68+
make build && make install
69+
5370
- name: Install Luacov
5471
run: |
72+
# Clear any existing cache
73+
rm -rf ~/.cache/luarocks || true
5574
/usr/local/openresty/luajit/bin/luarocks install luacov
5675
/usr/local/openresty/luajit/bin/luarocks install lua-resty-openssl
5776
58-
- uses: actions/checkout@v2
59-
6077
- name: Run tests
6178
run: make coverage
6279

0 commit comments

Comments
 (0)