| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| name: CI |
| |
| on: |
| pull_request: |
| push: |
| branches: |
| - master |
| tags: |
| - 'v*' |
| |
| jobs: |
| CI: |
| runs-on: ubuntu-18.04 |
| timeout-minutes: 180 |
| strategy: |
| fail-fast: true |
| steps: |
| - uses: actions/checkout@v1 |
| with: |
| submodules: true |
| - uses: leafo/gh-actions-lua@v5 |
| with: |
| luaVersion: "5.3.5" |
| - name: 'Install LuaRocks' |
| run: | |
| wget https://luarocks.org/releases/luarocks-3.3.0.tar.gz |
| tar zxpf luarocks-3.3.0.tar.gz |
| cd luarocks-3.3.0 |
| ./configure && make && sudo make install |
| cd .. |
| - name: 'Install Dependencies' |
| run: | |
| sudo luarocks install luaunit |
| sudo luarocks install lua-cjson 2.1.0-1 |
| - name: "Install OpenResty" |
| run: | |
| wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add - |
| sudo apt-get -y update --fix-missing |
| sudo apt-get -y install software-properties-common |
| sudo add-apt-repository -y "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" |
| sudo apt-get update |
| sudo apt-get install openresty-debug |
| - name: "Install test::nginx for testing" |
| run: | |
| sudo apt-get install -y cpanminus |
| sudo cpanm --notest Test::Nginx >build.log 2>&1 || (cat build.log && exit 1) |
| git clone https://github.com/iresty/test-nginx.git test-nginx |
| - name: 'Run Lua Tests' |
| run: | |
| cd lib/skywalking |
| lua util_test.lua |
| lua span_test.lua |
| lua tracing_context_test.lua |
| lua segment_ref_test.lua |
| cd .. |
| - name: 'Run Nginx Lua Tests' |
| run: | |
| export PATH=/usr/local/openresty-debug/nginx/sbin:/usr/local/openresty-debug/luajit/bin:$/usr/local/openresty-debug/bin:$PATH |
| prove -Itest-nginx/lib -r t |