Skip to content

Commit 970190e

Browse files
committed
CI: Cleanup configuration
1 parent fed4979 commit 970190e

File tree

3 files changed

+30
-43
lines changed

3 files changed

+30
-43
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,65 @@
11
name: CI
2+
23
on: [ push, pull_request, workflow_dispatch ]
4+
5+
permissions: {}
6+
37
jobs:
48
CI:
59
runs-on: ${{ matrix.os }}
10+
permissions:
11+
contents: read
612
strategy:
713
fail-fast: true
814
matrix:
915
include:
1016
- os: ubuntu-24.04
1117
nginx-version: 1.27.1
18+
1219
steps:
13-
- uses: actions/checkout@v4
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
1423
- name: Install dependencies
1524
run: |
1625
# for Test::Nginx
1726
curl -fsSL https://openresty.org/package/pubkey.gpg | sudo gpg --dearmor -o /usr/share/keyrings/openresty.gpg
1827
echo "deb [signed-by=/usr/share/keyrings/openresty.gpg] https://openresty.org/package/ubuntu $(lsb_release -sc) main" | \
1928
sudo tee /etc/apt/sources.list.d/openresty.list > /dev/null
2029
sudo apt-get update
21-
sudo apt-get install libtest-nginx-perl redis-server
30+
sudo apt-get install --no-install-recommends libtest-nginx-perl redis-server
31+
2232
- name: Install nginx
2333
env:
2434
NGINX_VERSION: ${{ matrix.nginx-version }}
25-
run: ci/install-nginx.sh --add-module=$GITHUB_WORKSPACE/
26-
- name: Build Redis rate limiter module
27-
run: ci/build-rate-limiter.sh
35+
working-directory: ${{ runner.temp }}
36+
run: |
37+
mkdir nginx
38+
curl -Ls https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz | \
39+
tar xzC nginx --strip-components=1
40+
cd nginx
41+
./configure --prefix="$HOME/nginx" --add-module=${{ github.workspace }}
42+
make -j$(nproc)
43+
make install
44+
2845
- name: Install Redis rate limiter module
46+
working-directory: ${{ runner.temp }}
2947
run: |
30-
sudo mkdir -p /usr/lib/redis/modules
31-
sudo mv rate-limiter/ratelimit.so /usr/lib/redis/modules/
48+
git clone https://github.com/onsigntv/redis-rate-limiter.git
49+
cd redis-rate-limiter
50+
make -j$(nproc) USE_MONOTONIC_CLOCK=1
51+
sudo install -D -t /usr/lib/redis/modules ratelimit.so
52+
3253
- name: Load Redis rate limiter module
3354
run: |
3455
# Redis < 7
3556
# redis-cli MODULE LOAD /usr/lib/redis/modules/ratelimit.so
3657
# Redis >= 7 (due to `enable-module-command no` restriction)
3758
echo "loadmodule /usr/lib/redis/modules/ratelimit.so" | sudo tee -a /etc/redis/redis.conf
3859
sudo service redis-server restart
60+
3961
- name: Prepare environment
4062
run: echo "$HOME/nginx/sbin" >> $GITHUB_PATH
63+
4164
- name: Run integration tests
4265
run: prove -r t

ci/build-rate-limiter.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

ci/install-nginx.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)