-
Notifications
You must be signed in to change notification settings - Fork 4
42 lines (42 loc) · 1.66 KB
/
ci.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
name: CI
on: [ push, pull_request, workflow_dispatch ]
jobs:
CI:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-24.04
nginx-version: 1.27.1
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
# for Test::Nginx
curl -fsSL https://openresty.org/package/pubkey.gpg | sudo gpg --dearmor -o /usr/share/keyrings/openresty.gpg
echo "deb [signed-by=/usr/share/keyrings/openresty.gpg] https://openresty.org/package/ubuntu $(lsb_release -sc) main" | \
sudo tee /etc/apt/sources.list.d/openresty.list > /dev/null
sudo apt-get update
sudo apt-get install libtest-nginx-perl redis-server
- name: Install nginx
env:
NGINX_VERSION: ${{ matrix.nginx-version }}
run: ci/install-nginx.sh --add-module=$GITHUB_WORKSPACE/
- name: Build Redis rate limiter module
run: ci/build-rate-limiter.sh
- name: Install Redis rate limiter module
run: |
sudo mkdir -p /usr/lib/redis/modules
sudo mv rate-limiter/ratelimit.so /usr/lib/redis/modules/
- name: Load Redis rate limiter module
run: |
# Redis < 7
# redis-cli MODULE LOAD /usr/lib/redis/modules/ratelimit.so
# Redis >= 7 (due to `enable-module-command no` restriction)
echo "loadmodule /usr/lib/redis/modules/ratelimit.so" | sudo tee -a /etc/redis/redis.conf
sudo service redis-server restart
- name: Prepare environment
run: echo "$HOME/nginx/sbin" >> $GITHUB_PATH
- name: Run integration tests
run: prove -r t