-
Notifications
You must be signed in to change notification settings - Fork 51
75 lines (61 loc) · 2.34 KB
/
build_and_test_with_worker_events.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build and test - with worker_events
concurrency:
# for PR's cancel the running task, if another commit is pushed
group: ${{ github.workflow }} ${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
on:
pull_request: {}
workflow_dispatch: {}
push:
branches:
- main
- master
jobs:
build:
name: CI using lua-resty-worker-events
runs-on: ubuntu-20.04
strategy:
matrix:
openresty-version: [1.21.4.1]
steps:
- name: Update and install OS dependencies
run: |
sudo apt-get update && sudo apt-get install -y libssl-dev ssl-cert
sudo systemctl disable nginx
sudo systemctl stop nginx
- name: Set environment variables
env:
OPENRESTY_VER: ${{ matrix.openresty-version }}
run: |
echo "/usr/local/openresty/nginx/sbin" >> $GITHUB_PATH
- name: Checkout lua-resty-healthcheck
uses: actions/checkout@v3
- name: Install OpenResty ${{ matrix.openresty-version }}
env:
OPENRESTY_VER: ${{ matrix.openresty-version }}
run: |
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~focal1
- name: Install LuaRocks
run: sudo apt-get install -y luarocks
- name: Install manual dependencies
run: |
sudo luarocks install luacheck
sudo luarocks install lua-resty-worker-events 1.0.0
- name: Install Test::NGINX
run: |
sudo apt-get install cpanminus
cpanm --notest --local-lib=$HOME/perl5 local::lib && eval $(perl -I $HOME/perl5/lib/perl5/ -Mlocal::lib)
cpanm --notest Test::Nginx
- name: Checkout lua-resty-healthcheck
uses: actions/checkout@v3
- name: Install lua-resty-healthcheck
run: sudo luarocks make
- name: Run tests
run: |
eval `luarocks path`
eval $(perl -I $HOME/perl5/lib/perl5/ -Mlocal::lib)
TEST_NGINX_TIMEOUT=4 TEST_NGINX_RANDOMIZE=1 prove -I. -r t/with_worker-events