1212 schedule :
1313 - cron : " 0 5 * * *" # runs every day at 5am UTC
1414
15- env :
16- DOCKER_NETWORK : ${{ github.run_id }}
17- DOCKER_NETWORK_ALIAS : nginx-plus-test
18- DOCKER_NGINX_PLUS : nginx-plus-${{ github.run_id }}
19- DOCKER_NGINX_PLUS_HELPER : nginx-plus-helper-${{ github.run_id }}
15+ defaults :
16+ run :
17+ shell : bash
2018
2119concurrency :
2220 group : ${{ github.ref_name }}-ci
@@ -26,6 +24,25 @@ permissions:
2624 contents : read
2725
2826jobs :
27+ unit-test :
28+ name : Unit Test
29+ runs-on : ubuntu-22.04
30+ permissions :
31+ contents : read
32+ strategy :
33+ matrix :
34+ go-version : ["1.19", "1.20", "1.21"]
35+ steps :
36+ - name : Checkout Repository
37+ uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
38+
39+ - name : Setup Golang Environment
40+ uses : actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
41+ with :
42+ go-version : ${{ matrix.go-version }}
43+
44+ - name : Run Unit Tests
45+ run : make unit-test
2946 build :
3047 name : Build Client
3148 runs-on : ubuntu-22.04
@@ -36,17 +53,14 @@ jobs:
3653 - name : Checkout Repository
3754 uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
3855
39- - name : Determine NGINX Plus version
40- run : echo "NGINX_PLUS_VERSION=$(cat Makefile | grep -m1 NGINX_PLUS_VERSION | cut -d "=" -f2)" >> $GITHUB_ENV
41-
4256 - name : Switch Repository (Nightly)
4357 if : (github.event_name == 'schedule')
4458 run : |
4559 sed -i 's|pkgs.nginx.com|pkgs-test.nginx.com|g' docker/Dockerfile
4660 sed -i '16d' docker/Dockerfile
4761 sed -i "17i sed -i 's|pkgs|pkgs-test|g' /etc/apt/apt.conf.d/90pkgs-nginx" docker/Dockerfile
4862 sed -i 's|deb https|deb [trusted=yes] https|g' docker/Dockerfile
49- sed -i 's|\${NGINX_PLUS_VERSION^^ }/||g' docker/Dockerfile
63+ sed -i 's|\${NGINX_PLUS_VERSION}/||g' docker/Dockerfile
5064
5165 - name : Set up Docker Buildx
5266 uses : docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2.9.1
@@ -55,25 +69,18 @@ jobs:
5569 uses : docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
5670 with :
5771 file : docker/Dockerfile
58- context : " docker"
59- tags : nginx-plus:${{ env.NGINX_PLUS_VERSION }}
72+ tags : nginx-plus
6073 cache-from : type=gha
6174 cache-to : type=gha,mode=max
6275 load : true
6376 secrets : |
6477 "nginx-repo.crt=${{ secrets.NGINX_CRT }}"
6578 "nginx-repo.key=${{ secrets.NGINX_KEY }}"
66- build-args : NGINX_PLUS_VERSION=${{ env.NGINX_PLUS_VERSION }}
6779
6880 - name : Test Client
69- if : (github.event_name != 'schedule')
70- run : make test
71-
72- - name : Test Client (Nightly)
73- if : (github.event_name == 'schedule')
74- run : make test
75- env :
76- NGINX_PLUS_VERSION : nightly
81+ run : |
82+ docker compose up -d
83+ docker compose logs -f test test-no-stream
7784
7885 - name : Create/Update Draft
7986 uses : lucacome/draft-release@f6dc37dcdf44be100a649b72c62c628776750190 # v0.2.2
0 commit comments