-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
30 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,65 @@ | ||
name: CI | ||
|
||
on: [ push, pull_request, workflow_dispatch ] | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
CI: | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
contents: read | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
include: | ||
- os: ubuntu-24.04 | ||
nginx-version: 1.27.1 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Checkout repository | ||
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 | ||
sudo apt-get install --no-install-recommends 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 | ||
working-directory: ${{ runner.temp }} | ||
run: | | ||
mkdir nginx | ||
curl -Ls https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz | \ | ||
tar xzC nginx --strip-components=1 | ||
cd nginx | ||
./configure --prefix="$HOME/nginx" --add-module=${{ github.workspace }} | ||
make -j$(nproc) | ||
make install | ||
- name: Install Redis rate limiter module | ||
working-directory: ${{ runner.temp }} | ||
run: | | ||
sudo mkdir -p /usr/lib/redis/modules | ||
sudo mv rate-limiter/ratelimit.so /usr/lib/redis/modules/ | ||
git clone https://github.com/onsigntv/redis-rate-limiter.git | ||
cd redis-rate-limiter | ||
make -j$(nproc) USE_MONOTONIC_CLOCK=1 | ||
sudo install -D -t /usr/lib/redis/modules ratelimit.so | ||
- 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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.