Skip to content

Commit 38cf3e5

Browse files
committed
Automate NGINX version testing in CI
Allows testing module build with latest stable and mainline NGINX without hardcoding its version and ensure it works with latest NGINX
1 parent 3274d53 commit 38cf3e5

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

.github/workflows/nginx-http-flv-module.yml

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,41 @@ on:
55
branches: [ "master" ]
66
pull_request:
77
branches: [ "master" ]
8+
schedule:
9+
# Schedule for testing with the latest NGINX to run at 00:00 on the first day of every month
10+
- cron: '0 0 1 * *'
811

912
jobs:
1013
build:
1114

1215
runs-on: ubuntu-latest
16+
strategy:
17+
max-parallel: 2
18+
matrix:
19+
nginx-branch: [stable, mainline]
20+
steps:
21+
- uses: actions/checkout@v3
1322

14-
env:
15-
NGINX_VERSION: nginx-1.22.1
23+
- name: Install build and test dependencies
24+
run: |
25+
sudo apt-get --yes update
26+
sudo apt-get install --yes libpcre3-dev libssl-dev perl cpanminus
1627
17-
steps:
18-
- uses: actions/checkout@v3
19-
- name: download nginx
20-
working-directory: ../
21-
run: wget https://nginx.org/download/${{env.NGINX_VERSION}}.tar.gz
22-
- name: uncompress nginx
23-
working-directory: ../
24-
run: tar zxvf ${{env.NGINX_VERSION}}.tar.gz
25-
- name: configure (build into nginx)
26-
working-directory: ../${{env.NGINX_VERSION}}
27-
run: ./configure --add-module=../nginx-http-flv-module
28-
- name: make
29-
working-directory: ../${{env.NGINX_VERSION}}
30-
run: make
31-
- name: clean
32-
working-directory: ../${{env.NGINX_VERSION}}
33-
run: make clean
34-
- name: configure (build as a dynamic module)
35-
working-directory: ../${{env.NGINX_VERSION}}
36-
run: ./configure --add-dynamic-module=../nginx-http-flv-module
37-
- name: make
38-
working-directory: ../${{env.NGINX_VERSION}}
39-
run: make
40-
- name: remove
41-
working-directory: ../
42-
run: rm -rf "${{env.NGINX_VERSION}}*"
28+
- name: Create NGINX download directory
29+
run: mkdir nginx
30+
31+
- name: Download ${{ matrix.nginx-branch }} NGINX
32+
uses: dvershinin/[email protected]
33+
with:
34+
repository: 'nginx'
35+
action: 'unzip'
36+
branch: ${{ matrix.nginx-branch }}
37+
working_directory: ./nginx
38+
39+
- name: Configure NGINX to compile with the module dynamically
40+
run: |
41+
cd nginx && ./configure --with-debug --add-dynamic-module=..
42+
43+
- name: Make NGINX module
44+
run: |
45+
cd nginx && make -j$(nproc) modules

0 commit comments

Comments
 (0)