Skip to content

Commit

Permalink
CI: Cleanup configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Jan 19, 2025
1 parent fed4979 commit 970190e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 43 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/ci.yml
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
14 changes: 0 additions & 14 deletions ci/build-rate-limiter.sh

This file was deleted.

22 changes: 0 additions & 22 deletions ci/install-nginx.sh

This file was deleted.

0 comments on commit 970190e

Please sign in to comment.