Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github actions #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
name: 'build'
runs-on: ubuntu-latest
steps:
- name: 'checkout'
uses: actions/checkout@v3
with:
path: nginx-module-vts
- name: 'checkout nginx'
uses: actions/checkout@v3
with:
repository: nginx/nginx
path: nginx
- name: 'checkout luajit2'
uses: actions/checkout@v3
with:
repository: openresty/luajit2
path: luajit2
- name: 'checkout ngx_devel_kit'
uses: actions/checkout@v3
with:
repository: vision5/ngx_devel_kit
path: ngx_devel_kit
- name: 'checkout lua-nginx-module'
uses: actions/checkout@v3
with:
repository: openresty/lua-nginx-module
path: lua-nginx-module
- name: 'checkout lua-resty-core'
uses: actions/checkout@v3
with:
repository: openresty/lua-resty-core
path: lua-resty-core
- name: 'checkout lua-resty-lrucache'
uses: actions/checkout@v3
with:
repository: openresty/lua-resty-lrucache
path: lua-resty-lrucache
- name: 'build luajit2'
working-directory: luajit2
run: |
make
sudo make install
sudo mkdir /usr/local/share/lua/5.1/resty
- name: 'link resty lib'
working-directory: /usr/local/share/lua/5.1/resty
run: |
sudo ln -s /home/runner/work/nginx-module-vts/nginx-module-vts/lua-resty-core/lib/resty/core core
sudo ln -s /home/runner/work/nginx-module-vts/nginx-module-vts/lua-resty-core/lib/resty/core.lua core.lua
sudo ln -s /home/runner/work/nginx-module-vts/nginx-module-vts/lua-resty-lrucache/lib/resty/lrucache lrucache
sudo ln -s /home/runner/work/nginx-module-vts/nginx-module-vts/lua-resty-lrucache/lib/resty/lrucache.lua lrucache.lua
- name: 'build nginx'
working-directory: nginx
run: |
./auto/configure --with-ld-opt="-Wl,-rpath,/usr/local/lib" --without-pcre2 --with-cc-opt=-Wno-stringop-overread --add-module=/home/runner/work/nginx-module-vts/nginx-module-vts/ngx_devel_kit --add-module=/home/runner/work/nginx-module-vts/nginx-module-vts/lua-nginx-module --add-module=/home/runner/work/nginx-module-vts/nginx-module-vts/nginx-module-vts
make
sudo make install
/usr/local/nginx/sbin/nginx -V
env:
LUAJIT_LIB: /usr/local/lib
LUAJIT_INC: /usr/local/include/luajit-2.1
- name: 'prepare cpanm'
run: |
sudo apt install -y cpanminus
sudo cpanm install Test::Nginx::Socket
- name: 'test'
working-directory: nginx-module-vts
run: |
echo "/usr/local/nginx/sbin/" >> $GITHUB_PATH
sudo PATH=/usr/local/nginx/sbin:$PATH prove -r t
8 changes: 4 additions & 4 deletions t/021.set_by_filter.t
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ __DATA__
'2xx:$2xx';
access_log logs/access.log basic;
upstream backend {
server localhost:1984;
server 127.0.0.1:1984;
}
--- config
location /status {
Expand All @@ -101,7 +101,7 @@ __DATA__
vhost_traffic_status_set_by_filter $outBytes $group/$zone/outBytes;
vhost_traffic_status_set_by_filter $2xx $group/$zone/2xx;

proxy_pass http://localhost:1984/return;
proxy_pass http://127.0.0.1:1984/return;
}
--- user_files eval
[
Expand Down Expand Up @@ -130,7 +130,7 @@ __DATA__
'2xx:$2xx';
access_log logs/access.log basic;
upstream backend {
server localhost:1984;
server 127.0.0.1:1984;
}
--- config
location /v {
Expand Down Expand Up @@ -211,7 +211,7 @@ __DATA__
'cacheUsedSize:$cacheUsedSize cacheHit:$cacheHit';
access_log logs/access.log basic;
upstream backend {
server localhost:1984;
server 127.0.0.1:1984;
}
--- config
location /v {
Expand Down