-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add github actions * Add test in github actions Co-authored-by: Amin Vakil <info@aminvakil.com>
- Loading branch information
Showing
2 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters