Skip to content

route443 is triggering pipeline #25

route443 is triggering pipeline

route443 is triggering pipeline #25

name: CI for NJS-based SAML Implementation
run-name: ${{ github.actor }} is triggering pipeline
on:
push:
workflow_dispatch:
jobs:
build-njs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: nginx/nginx
ref: release-1.27.4
path: nginx
- uses: actions/checkout@v4
with:
repository: bellard/quickjs
path: quickjs
- uses: actions/checkout@v4
with:
repository: nginx/njs
path: njs
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential \
libpcre3-dev zlib1g-dev libssl-dev \
libxml2-dev libxslt-dev
- name: Build QuickJS
working-directory: quickjs
run: |
CFLAGS='-fPIC' make libquickjs.a
- name: Build NJS module
working-directory: nginx
run: |
./auto/configure \
--add-dynamic-module=../njs/nginx \
--with-cc-opt="-I../quickjs" \
--with-ld-opt="-L../quickjs" \
--with-compat
make -j$(nproc) modules
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: njs-build
path: nginx/objs/ngx_http_js_module.so
test-njs-saml:
runs-on: ubuntu-latest
needs: build-njs
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get install -y apt-transport-https lsb-release apt-utils ubuntu-keyring gnupg2 \
ca-certificates wget
- name: Prepare keys and certificates
run: |
sudo mkdir /etc/ssl/nginx
echo '${{ secrets.NGINX_REPO_CRT }}' | sudo tee /etc/ssl/nginx/nginx-repo.crt > /dev/null
echo '${{ secrets.NGINX_REPO_KEY }}' | sudo tee /etc/ssl/nginx/nginx-repo.key > /dev/null
- name: Prepare NGINX Plus license token
run: |
echo '${{ secrets.NGINX_LIC }}' | tee $RUNNER_TEMP/lic > /dev/null
- name: Configure NGINX Plus repository
run: |
wget --certificate=/etc/ssl/nginx/nginx-repo.crt --private-key=/etc/ssl/nginx/nginx-repo.key \
https://pkgs-test.nginx.com/keys/nginx_test_signing.key
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/nginx_test_signing.gpg \
--import nginx_test_signing.key
echo "Acquire::https::pkgs-test.nginx.com::Verify-Peer \"true\";" | sudo tee -a /etc/apt/apt.conf.d/90nginx
echo "Acquire::https::pkgs-test.nginx.com::Verify-Host \"true\";" | sudo tee -a /etc/apt/apt.conf.d/90nginx
echo "Acquire::https::pkgs-test.nginx.com::SslCert \"/etc/ssl/nginx/nginx-repo.crt\";" \
| sudo tee -a /etc/apt/apt.conf.d/90nginx
echo "Acquire::https::pkgs-test.nginx.com::SslKey \"/etc/ssl/nginx/nginx-repo.key\";" \
| sudo tee -a /etc/apt/apt.conf.d/90nginx
printf "deb [signed-by=/usr/share/keyrings/nginx_test_signing.gpg] \
https://pkgs-test.nginx.com/nightly/ubuntu $(lsb_release -cs) nginx-plus\n" \
| sudo tee /etc/apt/sources.list.d/nginx-plus.list
- name: Install NGINX Plus
run: |
sudo apt-get update
sudo apt-get install -y nginx-plus nginx-plus-module-njs
- name: Install required Perl modules
run: |
sudo apt-get install -y perl libxml-libxml-perl libdatetime-perl libcrypt-openssl-x509-perl \
libcrypt-openssl-rsa-perl
- name: Checkout nginx-test
run: |
git clone https://github.com/nginx/nginx-tests.git
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: njs-build
path: ${{ runner.temp }}
- name: Run tests
working-directory: t
run: |
PERL5LIB=../nginx-tests/lib \
TEST_NGINX_BINARY=/usr/sbin/nginx \
TEST_NGINX_VERBOSE=1 \
TEST_NGINX_GLOBALS="load_module $RUNNER_TEMP/ngx_http_js_module.so; mgmt {license_token $RUNNER_TEMP/lic;}" \
TEST_NGINX_GLOBALS_HTTP="js_engine njs;" \
prove -v .