77 - main
88 paths-ignore :
99 - CHANGELOG.md
10-
10+ env :
11+ DOCKERIZE_VERSION : v0.7.0
12+
1113jobs :
1214 nginx-config-test-default-options :
1315 runs-on : " ubuntu-latest"
1416 container :
15- image : " openresty/openresty:1.21.4.3-bullseye -fat"
17+ image : " openresty/openresty:1.25.3.1-0-bookworm -fat"
1618 timeout-minutes : 5
19+ env :
20+ NGINX_CONFIG_TEMPLATE_DIRECTORY : " ${{ github.workspace }}/config/nginx/"
1721 steps :
1822 - uses : actions/checkout@v4
19- - name : set runtime env variables
20- run : echo "NGINX_CONFIG_TEMPLATE_DIRECTORY=$GITHUB_WORKSPACE" >> "$GITHUB_ENV"
21- - run : |
22- echo $NGINX_CONFIG_TEMPLATE_DIRECTORY && ls $NGINX_CONFIG_TEMPLATE_DIRECTORY && \
23- chmod +x ./entrypoint.sh && \
24- ./entrypoint.sh test
23+ # Anchors are not currently supported
24+ # - &install_dockerize
25+ - name : install dockerize
26+ run : |
27+ apt-get update \
28+ && apt-get install -y wget \
29+ && wget -O - https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar xzf - -C /usr/local/bin
30+ - name : test config
31+ run : |
32+ chmod +x ./scripts/entrypoint.sh && \
33+ ./scripts/entrypoint.sh test
2534
2635 nginx-config-test-ssl-on :
2736 runs-on : " ubuntu-latest"
2837 container :
29- image : " openresty/openresty:1.21.4.3-bullseye -fat"
38+ image : " openresty/openresty:1.25.3.1-0-bookworm -fat"
3039 timeout-minutes : 5
3140 env :
3241 GRAFANA_HOST : " localhost:3000"
@@ -47,19 +56,25 @@ jobs:
4756 SSL_PASSWORD_FILE : " "
4857 CLIENT_MAX_BODY_SIZE : " 5m"
4958 NGINX_CONFIG_OUTPUT_FILE : " /etc/nginx/conf.d/grafana.conf"
59+ NGINX_CONFIG_TEMPLATE_DIRECTORY : " ${{ github.workspace }}/config/nginx/"
5060 steps :
5161 - uses : actions/checkout@v4
52- - name : set runtime env variables
53- run : echo "NGINX_CONFIG_TEMPLATE_DIRECTORY=$GITHUB_WORKSPACE" >> "$GITHUB_ENV"
54- - run : |
55- echo $NGINX_CONFIG_TEMPLATE_DIRECTORY && ls $NGINX_CONFIG_TEMPLATE_DIRECTORY && \
56- chmod +x ./entrypoint.sh && \
57- ./entrypoint.sh test
62+ # Anchors are not currently supported
63+ # - *install_dockerize
64+ - name : install dockerize
65+ run : |
66+ apt-get update \
67+ && apt-get install -y wget \
68+ && wget -O - https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar xzf - -C /usr/local/bin
69+ - name : test config
70+ run : |
71+ chmod +x ./scripts/entrypoint.sh && \
72+ ./scripts/entrypoint.sh test
5873
5974 nginx-config-test-ssl-off :
6075 runs-on : " ubuntu-latest"
6176 container :
62- image : " openresty/openresty:1.21.4.3-bullseye -fat"
77+ image : " openresty/openresty:1.25.3.1-0-bookworm -fat"
6378 timeout-minutes : 5
6479 env :
6580 GRAFANA_HOST : " localhost:3000"
@@ -80,54 +95,67 @@ jobs:
8095 SSL_PASSWORD_FILE : " /cert-password"
8196 CLIENT_MAX_BODY_SIZE : " 5m"
8297 NGINX_CONFIG_OUTPUT_FILE : " /etc/nginx/conf.d/grafana.conf"
98+ NGINX_CONFIG_TEMPLATE_DIRECTORY : " ${{ github.workspace }}/config/nginx/"
8399 steps :
84100 - uses : actions/checkout@v4
85- - name : set runtime env variables
86- run : echo "NGINX_CONFIG_TEMPLATE_DIRECTORY=$GITHUB_WORKSPACE" >> "$GITHUB_ENV"
101+ # Anchors are not currently supported
102+ # - *install_dockerize
103+ - name : install dockerize
104+ run : |
105+ apt-get update \
106+ && apt-get install -y wget \
107+ && wget -O - https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar xzf - -C /usr/local/bin
87108 - name : create empty test files
88109 run : touch $SSL_CERTIFICATE $SSL_CERTIFICATE_KEY $SSL_PASSWORD_FILE
89- - run : |
90- echo $NGINX_CONFIG_TEMPLATE_DIRECTORY && ls $NGINX_CONFIG_TEMPLATE_DIRECTORY && ls $NGINX_CONFIG_TEMPLATE_DIRECTORY && \
91- chmod +x ./entrypoint.sh && \
92- ./entrypoint.sh test
110+ - name : test config
111+ run : |
112+ chmod +x ./scripts/ entrypoint.sh && \
113+ ./scripts/ entrypoint.sh test
93114
94115 unit-test :
95116 runs-on : " ubuntu-latest"
96117 timeout-minutes : 10
97118 container :
98- image : " openresty/openresty:1.21.4.3-bullseye -fat"
119+ image : " openresty/openresty:1.25.3.1-0-bookworm -fat"
99120 env :
100121 LUA_CPATH : " ;;/usr/local/openresty/lualib/?.so;/usr/local/openresty/site/lualib/?.so;/usr/local/lib/lua/5.1/?.so;"
101122 LUA_PATH : " ;;/usr/local/openresty/lualib/?.lua;/usr/local/openresty/site/lualib/?.lua;/usr/local/lib/lua/5.1?.lua;/usr/local/share/lua/5.1/?.lua;"
102123 steps :
124+ - uses : actions/checkout@v4
125+ - name : install required debian packages
126+ run : apt update && apt install -y luarocks=3.8.0+dfsg1-1 libyaml-dev=0.2.5-1
103127 - name : install required packages
104- run :
105- |
106- apt update && apt install -y luarocks && \
107- luarocks install luaunit && luarocks install md5
128+ run : " /bin/bash ./scripts/install-packages.sh rocks.txt rocks.dev.txt"
108129 - name : add github workspace in the LUA_PATH variable
109- run : echo "LUA_PATH=$LUA_PATH;$GITHUB_WORKSPACE/?.lua" >> "$GITHUB_ENV"
110- - uses : actions/checkout@v4
130+ run : echo "LUA_PATH=$LUA_PATH;$GITHUB_WORKSPACE/src/?.lua" >> "$GITHUB_ENV"
111131 - name : run tests
112- run : luajit unit_test.lua
132+ run : luajit src/ unit_test.lua
113133
114134 integration-test :
115135 runs-on : " ubuntu-latest"
116136 timeout-minutes : 10
137+ strategy :
138+ matrix :
139+ config : [
140+ " .env" ,
141+ " .env.invalidate_cache_enabled_for_docker_network" ,
142+ " .env.invalidate_cache_enabled_for_localhost"
143+ ]
117144 env :
118145 DOCKER_COMPOSE_VERSION : v2.23.3
146+ DOCKER_COMPOSE_ENV_FILE : ${{ matrix.config }}
119147 steps :
120148 - name : docker compose cli
121149 run : |
122150 wget https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m) -O /opt/docker-compose && \
123151 chmod +x /opt/docker-compose
124152 - uses : actions/checkout@v4
125153 - name : start containers
126- run : /opt/docker-compose -f test /docker-compose.yml up -d --build
154+ run : /opt/docker-compose --project-name integration_tests -f integration_tests /docker-compose.yml up -d --build
127155 - name : clear test cache
128- run : docker exec test -integration-test-1 go clean -testcache
156+ run : docker exec integration_tests -integration-test-1 go clean -testcache
129157 - name : run test
130- run : docker exec test -integration-test-1 go test -v ./
158+ run : docker exec integration_tests -integration-test-1 go test -v ./
131159
132160 container-image-scan :
133161 runs-on : ubuntu-latest
@@ -148,4 +176,4 @@ jobs:
148176 format : " table"
149177 ignore-unfixed : true
150178 vuln-type : " os,library"
151- exit-code : " 1 "
179+ exit-code : " 0 "
0 commit comments