|
6 | 6 | workflow_dispatch:
|
7 | 7 |
|
8 | 8 | jobs:
|
| 9 | + build-njs: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + with: |
| 14 | + repository: nginx/nginx |
| 15 | + ref: release-1.27.4 |
| 16 | + path: nginx |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + with: |
| 19 | + repository: bellard/quickjs |
| 20 | + path: quickjs |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + repository: nginx/njs |
| 24 | + path: njs |
| 25 | + |
| 26 | + - name: Install dependencies |
| 27 | + run: | |
| 28 | + sudo apt-get update |
| 29 | + sudo apt-get install -y build-essential \ |
| 30 | + libpcre3-dev zlib1g-dev libssl-dev \ |
| 31 | + libxml2-dev libxslt-dev |
| 32 | +
|
| 33 | + - name: Build QuickJS |
| 34 | + working-directory: quickjs |
| 35 | + run: | |
| 36 | + CFLAGS='-fPIC' make libquickjs.a |
| 37 | +
|
| 38 | + - name: Build NJS module |
| 39 | + working-directory: nginx |
| 40 | + run: | |
| 41 | + ./auto/configure \ |
| 42 | + --add-dynamic-module=../njs/nginx \ |
| 43 | + --with-cc-opt="-I../quickjs" \ |
| 44 | + --with-ld-opt="-L../quickjs" \ |
| 45 | + --with-compat |
| 46 | + make -j$(nproc) modules |
| 47 | +
|
| 48 | + - name: Upload build artifacts |
| 49 | + uses: actions/upload-artifact@v4 |
| 50 | + with: |
| 51 | + name: njs-build |
| 52 | + path: nginx/objs/ngx_http_js_module.so |
| 53 | + |
9 | 54 | test-njs-saml:
|
10 | 55 | runs-on: ubuntu-latest
|
| 56 | + needs: build-njs |
11 | 57 | steps:
|
12 | 58 | - name: Checkout repository
|
13 |
| - uses: actions/checkout@v3 |
| 59 | + uses: actions/checkout@v4 |
14 | 60 |
|
15 | 61 | - name: Install prerequisites
|
16 | 62 | run: |
|
17 | 63 | sudo apt-get update
|
18 | 64 | sudo apt-get install -y apt-transport-https lsb-release apt-utils ubuntu-keyring gnupg2 \
|
19 |
| - ca-certificates wget mercurial |
| 65 | + ca-certificates wget |
20 | 66 |
|
21 | 67 | - name: Prepare keys and certificates
|
22 | 68 | run: |
|
@@ -58,9 +104,18 @@ jobs:
|
58 | 104 | run: |
|
59 | 105 | git clone https://github.com/nginx/nginx-tests.git
|
60 | 106 |
|
| 107 | + - name: Download build artifacts |
| 108 | + uses: actions/download-artifact@v4 |
| 109 | + with: |
| 110 | + name: njs-build |
| 111 | + path: ${{ runner.temp }} |
| 112 | + |
61 | 113 | - name: Run tests
|
62 | 114 | working-directory: t
|
63 | 115 | run: |
|
64 |
| - PERL5LIB=../nginx-tests/lib TEST_NGINX_BINARY=/usr/sbin/nginx TEST_NGINX_VERBOSE=1 \ |
65 |
| - TEST_NGINX_GLOBALS="load_module /etc/nginx/modules/ngx_http_js_module-debug.so; mgmt {license_token $RUNNER_TEMP/lic;}" \ |
| 116 | + PERL5LIB=../nginx-tests/lib \ |
| 117 | + TEST_NGINX_BINARY=/usr/sbin/nginx \ |
| 118 | + TEST_NGINX_VERBOSE=1 \ |
| 119 | + TEST_NGINX_GLOBALS="load_module $RUNNER_TEMP/ngx_http_js_module.so; mgmt {license_token $RUNNER_TEMP/lic;}" \ |
| 120 | + TEST_NGINX_GLOBALS_HTTP="js_engine njs;" \ |
66 | 121 | prove -v .
|
0 commit comments