Skip to content

Commit d10fd6d

Browse files
authored
ci: enable (#6)
1 parent 51bfc36 commit d10fd6d

File tree

4 files changed

+71
-1
lines changed

4 files changed

+71
-1
lines changed

.github/workflows/ci.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: "ubuntu-18.04"
12+
env:
13+
OPENRESTY_PREFIX: "/usr/local/openresty"
14+
15+
steps:
16+
- name: Check out code
17+
uses: actions/checkout@v2
18+
19+
- name: Get dependencies
20+
run: sudo apt install -y cpanminus build-essential libncurses5-dev libreadline-dev libssl-dev perl
21+
22+
- name: Before install
23+
run: |
24+
sudo cpanm --notest Test::Nginx > build.log 2>&1 || (cat build.log && exit 1)
25+
git clone https://github.com/iresty/test-nginx.git test-nginx
26+
27+
- name: Install
28+
run: |
29+
wget https://raw.githubusercontent.com/api7/apisix-build-tools/master/build-apisix-openresty.sh
30+
chmod +x build-apisix-openresty.sh
31+
OR_PREFIX=$OPENRESTY_PREFIX ./build-apisix-openresty.sh latest
32+
33+
34+
- name: Script
35+
run: |
36+
export PATH=$OPENRESTY_PREFIX/nginx/sbin:$PATH
37+
prove -I. -Itest-nginx/lib -r t/

.github/workflows/lint.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: "ubuntu-18.04"
12+
13+
steps:
14+
- name: Check out code
15+
uses: actions/checkout@v2
16+
17+
- name: Get dependencies
18+
run: |
19+
sudo apt install -y luarocks
20+
sudo luarocks install luacheck > build.log 2>&1 || (cat build.log && exit 1)
21+
22+
- name: Script
23+
run: |
24+
luacheck .

.luacheckrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
ignore = {
2+
'_',
3+
}
4+
std = 'ngx_lua'
5+
globals = { 'ngx' }
6+
unused_args = false
7+
redefined = false
8+
read_globals = {
9+
"coroutine._yield"
10+
}

lib/resty/apisix/upstream.lua

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ local ffi = require("ffi")
22
local base = require("resty.core.base")
33
local get_request = base.get_request
44
local C = ffi.C
5-
local error = error
65
local NGX_ERROR = ngx.ERROR
76

87

0 commit comments

Comments
 (0)