Skip to content

Commit

Permalink
Add github actions (#238)
Browse files Browse the repository at this point in the history
* Add github actions
* Add test in github actions

Co-authored-by: Amin Vakil <[email protected]>
  • Loading branch information
u5surf and aminvakil authored Sep 5, 2022
1 parent 7e81230 commit 1266e0b
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion t/021.set_by_filter.t
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1266e0b

Please sign in to comment.