Skip to content

Commit

Permalink
chore(workflows) debug
Browse files Browse the repository at this point in the history
  • Loading branch information
locao committed Jun 3, 2022
1 parent 1250448 commit 6f07fa4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 301 deletions.
194 changes: 0 additions & 194 deletions .github/workflows/build_and_test_with_resty_events.yml

This file was deleted.

135 changes: 28 additions & 107 deletions .github/workflows/build_and_test_with_worker_events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,22 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
openresty-version: [1.15.8.3, 1.17.8.2, 1.19.9.1, 1.21.4.1]
luarocks-version: [3.9.0]
openresty-version: [1.15.8.3]

steps:
- name: Update and install OS dependencies
run: sudo apt-get update && sudo apt-get install -y libssl-dev ssl-cert

- name: Set environment variables
env:
LUAROCKS_VER: ${{ matrix.luarocks-version }}
OPENRESTY_VER: ${{ matrix.openresty-version }}
run: |
echo "DOWNLOAD_PATH=$HOME/download-root" >> $GITHUB_ENV
export DOWNLOAD_PATH=$HOME/download-root
echo "INSTALL_PATH=$HOME/install-root" >> $GITHUB_ENV
export INSTALL_PATH=$HOME/install-root
echo "LUAROCKS_VER=$LUAROCKS_VER" >> $GITHUB_ENV
echo "OPENRESTY_VER=$OPENRESTY_VER" >> $GITHUB_ENV
export LUAROCKS_PREFIX=$INSTALL_PATH/luarocks-$LUAROCKS_VER
echo "LUAROCKS_PREFIX=$LUAROCKS_PREFIX" >> $GITHUB_ENV
export OPENRESTY_PREFIX=$INSTALL_PATH/openresty-$OPENRESTY_VER
echo "OPENRESTY_PREFIX=$OPENRESTY_PREFIX" >> $GITHUB_ENV
echo "PATH=$DOWNLOAD_PATH:$LUAROCKS_PREFIX/bin:$OPENRESTY_PREFIX/nginx/sbin:$DOWNLOAD_PATH/cpanm:$PATH" >> $GITHUB_ENV
echo "PATH=$DOWNLOAD_PATH/cpanm:$PATH" >> $GITHUB_ENV
- name: Checkout lua-resty-healthcheck
uses: actions/checkout@v2
Expand All @@ -50,47 +43,28 @@ jobs:
mkdir -p $DOWNLOAD_PATH
mkdir -p $INSTALL_PATH
- name: Build and install OpenResty ${{ matrix.openresty-version }}
- name: Install OpenResty ${{ matrix.openresty-version }}
env:
OPENRESTY_VER: ${{ matrix.openresty-version }}
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
if [ ! -d $INSTALL_PATH/openresty-$OPENRESTY_VER ];
then
pushd $DOWNLOAD_PATH
echo "Downloading from http://openresty.org/download/openresty-$OPENRESTY_VER.tar.gz"
wget -O $DOWNLOAD_PATH/openresty-$OPENRESTY_VER.tar.gz http://openresty.org/download/openresty-$OPENRESTY_VER.tar.gz
echo "tar -zxf $DOWNLOAD_PATH/openresty-$OPENRESTY_VER.tar.gz"
tar -zxf $DOWNLOAD_PATH/openresty-$OPENRESTY_VER.tar.gz
echo "result: $?"
pushd openresty-$OPENRESTY_VER
./configure --prefix=$OPENRESTY_PREFIX
make
make install
popd
popd
fi
- name: Build and install LuaRocks ${{ matrix.luarocks-version }}
sudo systemctl disable nginx
sudo systemctl stop nginx
sudo apt-get -y install --no-install-recommends wget gnupg ca-certificates
wget -O - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
echo "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/openresty.list
sudo apt-get update
sudo apt-get -y install openresty=$OPENRESTY_VER-1~bionic1
- name: Install LuaRocks
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
if [ ! -d $INSTALL_PATH/luarocks-$LUAROCKS_VER ];
then
pushd $DOWNLOAD_PATH
echo "Downloading from https://luarocks.github.io/luarocks/releases/luarocks-$LUAROCKS_VER.tar.gz"
wget -O $DOWNLOAD_PATH/luarocks-$LUAROCKS_VER.tar.gz https://luarocks.github.io/luarocks/releases/luarocks-$LUAROCKS_VER.tar.gz
tar -zxf $DOWNLOAD_PATH/luarocks-$LUAROCKS_VER.tar.gz
pushd luarocks-$LUAROCKS_VER
./configure --prefix=$LUAROCKS_PREFIX --with-lua=$OPENRESTY_PREFIX/luajit --with-lua-include=$OPENRESTY_PREFIX/luajit/include/luajit-2.1 --lua-suffix=jit
make build
make install
popd
popd
fi
run: sudo apt-get install -y luarocks

- name: Install manual dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
luarocks install luacheck
luarocks install lua-resty-worker-events 1.0.0
sudo luarocks install luacheck
sudo luarocks install lua-resty-worker-events 1.0.0
- name: Install Test::NGINX
if: steps.cache-deps.outputs.cache-hit != 'true'
Expand All @@ -103,78 +77,17 @@ jobs:
cpanm --notest Test::Nginx
fi
lint:
name: Static code analysis
runs-on: ubuntu-18.04
needs: build
strategy:
matrix:
openresty-version: [1.15.8.3, 1.17.8.2, 1.19.9.1, 1.21.4.1]
luarocks-version: [3.9.0]
steps:
- name: Checkout lua-resty-healthcheck
uses: actions/checkout@v2

- name: Set environment variables
env:
LUAROCKS_VER: ${{ matrix.luarocks-version }}
OPENRESTY_VER: ${{ matrix.openresty-version }}
run: |
echo "DOWNLOAD_PATH=$HOME/download-root" >> $GITHUB_ENV
export DOWNLOAD_PATH=$HOME/download-root
echo "INSTALL_PATH=$HOME/install-root" >> $GITHUB_ENV
export INSTALL_PATH=$HOME/install-root
echo "LUAROCKS_VER=$LUAROCKS_VER" >> $GITHUB_ENV
echo "OPENRESTY_VER=$OPENRESTY_VER" >> $GITHUB_ENV
export LUAROCKS_PREFIX=$INSTALL_PATH/luarocks-$LUAROCKS_VER
echo "LUAROCKS_PREFIX=$LUAROCKS_PREFIX" >> $GITHUB_ENV
export OPENRESTY_PREFIX=$INSTALL_PATH/openresty-$OPENRESTY_VER
echo "OPENRESTY_PREFIX=$OPENRESTY_PREFIX" >> $GITHUB_ENV
echo "PATH=$DOWNLOAD_PATH:$LUAROCKS_PREFIX/bin:$OPENRESTY_PREFIX/nginx/sbin:$DOWNLOAD_PATH/cpanm:$PATH" >> $GITHUB_ENV
- name: Lookup build cache
uses: actions/cache@v2
id: cache-deps
with:
path: |
${{ env.INSTALL_PATH }}
~/perl5
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/build_and_test_with_worker_events.yml') }}

- name: Lint code
run: |
eval `luarocks path`
luacheck lib
install-and-test:
name: Test lua-resty-healthcheck
runs-on: ubuntu-18.04
needs: build
strategy:
matrix:
openresty-version: [1.15.8.3, 1.17.8.2, 1.19.9.1, 1.21.4.1]
luarocks-version: [3.9.0]
openresty-version: [1.15.8.3]
steps:
- name: Checkout lua-resty-healthcheck
uses: actions/checkout@v2

- name: Set environment variables
env:
LUAROCKS_VER: ${{ matrix.luarocks-version }}
OPENRESTY_VER: ${{ matrix.openresty-version }}
run: |
echo "DOWNLOAD_PATH=$HOME/download-root" >> $GITHUB_ENV
export DOWNLOAD_PATH=$HOME/download-root
echo "INSTALL_PATH=$HOME/install-root" >> $GITHUB_ENV
export INSTALL_PATH=$HOME/install-root
echo "LUAROCKS_VER=$LUAROCKS_VER" >> $GITHUB_ENV
echo "OPENRESTY_VER=$OPENRESTY_VER" >> $GITHUB_ENV
export LUAROCKS_PREFIX=$INSTALL_PATH/luarocks-$LUAROCKS_VER
echo "LUAROCKS_PREFIX=$LUAROCKS_PREFIX" >> $GITHUB_ENV
export OPENRESTY_PREFIX=$INSTALL_PATH/openresty-$OPENRESTY_VER
echo "OPENRESTY_PREFIX=$OPENRESTY_PREFIX" >> $GITHUB_ENV
echo "PATH=$DOWNLOAD_PATH:$LUAROCKS_PREFIX/bin:$OPENRESTY_PREFIX/nginx/sbin:$DOWNLOAD_PATH/cpanm:$PATH" >> $GITHUB_ENV
- name: Lookup build cache
uses: actions/cache@v2
id: cache-deps
Expand All @@ -185,10 +98,18 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/build_and_test_with_worker_events.yml') }}

- name: Install lua-resty-healthcheck
run: luarocks make
run: sudo luarocks make

- name: Run tests
run: |
eval `luarocks path`
eval $(perl -I $HOME/perl5/lib/perl5/ -Mlocal::lib)
echo "GITHUB_PATH"
echo "$GITHUB_PATH"
echo "PATH"
echo "$PATH"
echo "which nginx"
which nginx
nginx -V
env
TEST_NGINX_RANDOMIZE=1 prove -I. -r t

0 comments on commit 6f07fa4

Please sign in to comment.