fix: ci workflow #167
Workflow file for this run
This file contains hidden or 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
| name: Test | |
| on: [push, pull_request] | |
| jobs: | |
| luacheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: leafo/gh-actions-lua@v8 | |
| with: | |
| luaVersion: "luajit-openresty" | |
| - uses: leafo/gh-actions-luarocks@v5 | |
| with: | |
| luarocksVersion: "3.12.2" | |
| - run: luarocks install luacheck | |
| - run: luacheck lib | |
| run_tests: | |
| strategy: | |
| matrix: | |
| openresty_version: | |
| - 1.17.8.2 | |
| - 1.19.9.1 | |
| - 1.21.4.3 | |
| - 1.25.3.1 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: openresty/openresty:${{ matrix.openresty_version }}-alpine-fat | |
| # --init runs tinit as PID 1 and prevents the 'WARNING: killing the child process' spam from the test suite | |
| options: --init | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install deps | |
| run: | | |
| apk add --no-cache curl perl bash wget git perl-dev libarchive-tools nodejs build-base | |
| ln -s /usr/bin/bsdtar /usr/bin/tar | |
| - name: Install CPAN | |
| run: curl -s -L http://xrl.us/cpanm > /bin/cpanm && chmod +x /bin/cpanm | |
| - name: Cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cpan | |
| ~/.cache | |
| key: ${{ runner.os }}-${{ matrix.openresty_version }}-cache | |
| - name: Install Test::Nginx | |
| run: cpanm -q -n Test::Nginx | |
| - name: Install latest LuaRocks | |
| run: | | |
| # Remove old luarocks if exists | |
| rm -rf /usr/local/openresty/luajit/bin/luarocks* || true | |
| # Download and install latest LuaRocks | |
| cd /tmp | |
| wget https://luarocks.org/releases/luarocks-3.12.2.tar.gz | |
| tar zxpf luarocks-3.12.2.tar.gz | |
| cd luarocks-3.12.2 | |
| ./configure --prefix=/usr/local/openresty/luajit \ | |
| --with-lua=/usr/local/openresty/luajit \ | |
| --lua-suffix=jit \ | |
| --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 | |
| make build && make install | |
| - name: Install Luacov | |
| run: | | |
| # Clear any existing cache | |
| rm -rf ~/.cache/luarocks || true | |
| /usr/local/openresty/luajit/bin/luarocks install luacov | |
| /usr/local/openresty/luajit/bin/luarocks install lua-resty-openssl | |
| - name: Run tests | |
| run: make coverage | |
| - name: Coverage | |
| run: | | |
| luacov | |
| tail -n 8 luacov.report.out |