12
12
schedule :
13
13
- cron : " 0 5 * * *" # runs every day at 5am UTC
14
14
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
20
18
21
19
concurrency :
22
20
group : ${{ github.ref_name }}-ci
@@ -26,6 +24,25 @@ permissions:
26
24
contents : read
27
25
28
26
jobs :
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
29
46
build :
30
47
name : Build Client
31
48
runs-on : ubuntu-22.04
@@ -36,17 +53,14 @@ jobs:
36
53
- name : Checkout Repository
37
54
uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
38
55
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
-
42
56
- name : Switch Repository (Nightly)
43
57
if : (github.event_name == 'schedule')
44
58
run : |
45
59
sed -i 's|pkgs.nginx.com|pkgs-test.nginx.com|g' docker/Dockerfile
46
60
sed -i '16d' docker/Dockerfile
47
61
sed -i "17i sed -i 's|pkgs|pkgs-test|g' /etc/apt/apt.conf.d/90pkgs-nginx" docker/Dockerfile
48
62
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
50
64
51
65
- name : Set up Docker Buildx
52
66
uses : docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2.9.1
@@ -55,25 +69,18 @@ jobs:
55
69
uses : docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
56
70
with :
57
71
file : docker/Dockerfile
58
- context : " docker"
59
- tags : nginx-plus:${{ env.NGINX_PLUS_VERSION }}
72
+ tags : nginx-plus
60
73
cache-from : type=gha
61
74
cache-to : type=gha,mode=max
62
75
load : true
63
76
secrets : |
64
77
"nginx-repo.crt=${{ secrets.NGINX_CRT }}"
65
78
"nginx-repo.key=${{ secrets.NGINX_KEY }}"
66
- build-args : NGINX_PLUS_VERSION=${{ env.NGINX_PLUS_VERSION }}
67
79
68
80
- 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
77
84
78
85
- name : Create/Update Draft
79
86
uses : lucacome/draft-release@f6dc37dcdf44be100a649b72c62c628776750190 # v0.2.2
0 commit comments