CI: Upgrade nginx to version 1.27.3 #12
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
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.3 | |
steps: | |
- 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 --no-install-recommends libtest-nginx-perl redis-server | |
- name: Install nginx | |
env: | |
NGINX_VERSION: ${{ matrix.nginx-version }} | |
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: | | |
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 |