Skip to content

Commit acbf861

Browse files
committed
chore(CI): fix broken CI
1 parent 02dc08c commit acbf861

File tree

5 files changed

+67
-32
lines changed

5 files changed

+67
-32
lines changed

.github/workflows/codecov.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
name: codecov
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- lts
8+
- lts-dev
9+
- current
10+
- current-dev
11+
pull_request:
412

513
defaults:
614
run:
715
shell: bash
816

17+
# cancel previous runs if new commits are pushed to the PR, but run for each commit on master
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
922
jobs:
1023
build_deps:
1124
name: Build dependencies
@@ -19,7 +32,7 @@ jobs:
1932
run: |
2033
echo "CACHE_ROOT=$HOME/cache-root" >> $GITHUB_ENV
2134
22-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v4
2336
with:
2437
ref: ${{ github.ref }}
2538

@@ -45,6 +58,9 @@ jobs:
4558
if: steps.cache-deps.outputs.cache-hit != 'true'
4659
run: |
4760
sudo apt-get --yes update
61+
# https://github.com/actions/runner-images/issues/2139
62+
sudo apt-get remove nginx-core nginx-full nginx-light nginx-extras
63+
sudo apt-get remove libgd3
4864
sudo apt-get install --yes libsodium23 libsodium-dev build-essential zlib1g-dev libpcre3 libpcre3-dev libssl-dev libxslt1-dev libxml2-dev libgeoip-dev libgd-dev libperl-dev libcurl4-openssl-dev
4965
5066
- name: Download and install ModSecurity
@@ -83,7 +99,7 @@ jobs:
8399
python-version: '3.x'
84100
architecture: 'x64'
85101

86-
- uses: actions/checkout@v2
102+
- uses: actions/checkout@v4
87103
with:
88104
ref: ${{ github.ref }}
89105

@@ -111,6 +127,9 @@ jobs:
111127
- name: Install dependencies
112128
run: |
113129
sudo apt-get --yes update
130+
# https://github.com/actions/runner-images/issues/2139
131+
sudo apt-get remove nginx-core nginx-full nginx-light nginx-extras
132+
sudo apt-get remove libgd3
114133
sudo apt-get install --yes libsodium23 libsodium-dev build-essential zlib1g-dev libpcre3 libpcre3-dev libssl-dev libxslt1-dev libxml2-dev libgeoip-dev libgd-dev libperl-dev libcurl4-openssl-dev gcovr
115134
116135
- name: Download nginx

.github/workflows/docker.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ jobs:
2525
matrix:
2626
target: ['glibc', 'musl']
2727
steps:
28-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v4
2929
with:
3030
ref: ${{ github.ref }}
3131
- name: Set up QEMU
32-
uses: docker/setup-qemu-action@v1
32+
uses: docker/setup-qemu-action@v3
3333
- name: Set up Docker Buildx
34-
uses: docker/setup-buildx-action@v1
34+
uses: docker/setup-buildx-action@v3
3535
- name: Login to DockerHub
3636
uses: docker/login-action@v1
3737
with:
@@ -67,13 +67,13 @@ jobs:
6767
matrix:
6868
target: ['glibc', 'musl']
6969
steps:
70-
- uses: actions/checkout@v2
70+
- uses: actions/checkout@v4
7171
with:
7272
ref: ${{ github.ref }}
7373
- name: Set up QEMU
74-
uses: docker/setup-qemu-action@v1
74+
uses: docker/setup-qemu-action@v3
7575
- name: Set up Docker Buildx
76-
uses: docker/setup-buildx-action@v1
76+
uses: docker/setup-buildx-action@v3
7777
- name: Login to DockerHub
7878
uses: docker/login-action@v1
7979
with:
@@ -109,13 +109,13 @@ jobs:
109109
matrix:
110110
target: ['glibc', 'musl']
111111
steps:
112-
- uses: actions/checkout@v2
112+
- uses: actions/checkout@v4
113113
with:
114114
ref: ${{ github.ref }}
115115
- name: Set up QEMU
116-
uses: docker/setup-qemu-action@v1
116+
uses: docker/setup-qemu-action@v3
117117
- name: Set up Docker Buildx
118-
uses: docker/setup-buildx-action@v1
118+
uses: docker/setup-buildx-action@v3
119119
- name: Login to DockerHub
120120
uses: docker/login-action@v1
121121
with:
@@ -151,13 +151,13 @@ jobs:
151151
matrix:
152152
target: ['glibc', 'musl']
153153
steps:
154-
- uses: actions/checkout@v2
154+
- uses: actions/checkout@v4
155155
with:
156156
ref: ${{ github.ref }}
157157
- name: Set up QEMU
158-
uses: docker/setup-qemu-action@v1
158+
uses: docker/setup-qemu-action@v3
159159
- name: Set up Docker Buildx
160-
uses: docker/setup-buildx-action@v1
160+
uses: docker/setup-buildx-action@v3
161161
- name: Login to DockerHub
162162
uses: docker/login-action@v1
163163
with:

.github/workflows/test.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
name: test
22

3-
on:
4-
push:
3+
on:
4+
push:
55
branches:
6+
- master
7+
- lts
8+
- lts-dev
9+
- current
10+
- current-dev
611
pull_request:
712
schedule:
813
- cron: '0 0 * * SUN'
@@ -13,6 +18,11 @@ defaults:
1318
run:
1419
shell: bash
1520

21+
# cancel previous runs if new commits are pushed to the PR, but run for each commit on master
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
24+
cancel-in-progress: true
25+
1626
jobs:
1727
self-trigger:
1828
runs-on: ubuntu-latest
@@ -43,7 +53,7 @@ jobs:
4353
run: |
4454
echo "CACHE_ROOT=$HOME/cache-root" >> $GITHUB_ENV
4555
46-
- uses: actions/checkout@v2
56+
- uses: actions/checkout@v4
4757
with:
4858
ref: ${{ github.ref }}
4959

@@ -69,6 +79,9 @@ jobs:
6979
if: steps.cache-deps.outputs.cache-hit != 'true'
7080
run: |
7181
sudo apt-get --yes update
82+
# https://github.com/actions/runner-images/issues/2139
83+
sudo apt-get remove nginx-core nginx-full nginx-light nginx-extras
84+
sudo apt-get remove libgd3
7285
sudo apt-get install --yes libsodium23 libsodium-dev build-essential zlib1g-dev libpcre3 libpcre3-dev libssl-dev libxslt1-dev libxml2-dev libgeoip-dev libgd-dev libperl-dev libcurl4-openssl-dev
7386
7487
- name: Download and install ModSecurity
@@ -115,7 +128,7 @@ jobs:
115128
python-version: '3.x'
116129
architecture: 'x64'
117130

118-
- uses: actions/checkout@v2
131+
- uses: actions/checkout@v4
119132
with:
120133
ref: ${{ github.ref }}
121134

@@ -143,6 +156,9 @@ jobs:
143156
- name: Install dependencies
144157
run: |
145158
sudo apt-get --yes update
159+
# https://github.com/actions/runner-images/issues/2139
160+
sudo apt-get remove nginx-core nginx-full nginx-light nginx-extras
161+
sudo apt-get remove libgd3
146162
sudo apt-get install --yes libsodium23 libsodium-dev build-essential zlib1g-dev libpcre3 libpcre3-dev libssl-dev libxslt1-dev libxml2-dev libgeoip-dev libgd-dev libperl-dev libcurl4-openssl-dev
147163
148164
- name: Download nginx-${{ matrix.nginx-version }}
@@ -222,21 +238,21 @@ jobs:
222238
version: ['stable', 'mainline']
223239
target: ['glibc', 'musl']
224240
steps:
225-
- uses: actions/checkout@v2
241+
- uses: actions/checkout@v4
226242
with:
227243
ref: ${{ github.ref }}
228244
- name: Set up QEMU
229-
uses: docker/setup-qemu-action@v1
245+
uses: docker/setup-qemu-action@v3
230246
- name: Set up Docker Buildx
231-
uses: docker/setup-buildx-action@v1
247+
uses: docker/setup-buildx-action@v3
232248
- name: Build module
233249
run: docker build --file docker/Dockerfile.${{ matrix.target }} --build-arg=NGX_VER=${{ matrix.version }} .
234250
triger:
235251
runs-on: ubuntu-latest
236252
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (github.ref == 'refs/heads/lts' || github.ref == 'refs/heads/current')) }}
237253
needs: ['native', 'docker']
238254
steps:
239-
- uses: actions/checkout@v2
255+
- uses: actions/checkout@v4
240256
with:
241257
ref: ${{ github.ref }}
242258
- uses: actions/setup-python@v2

docker/Dockerfile.glibc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG NGX_VER=stable
22
FROM nginx:${NGX_VER} as base
3-
ARG CHANGE_SOURCE=false
3+
ARG CN_MIRROR=false
44
ARG NGX_VER=stable
55
ARG LIB_SODIUM_VER=1.0.18-RELEASE
66

@@ -9,7 +9,7 @@ COPY . ./ngx_waf
99

1010
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
1111
RUN set -xe \
12-
&& if [ ${CHANGE_SOURCE} == true ] ; then \
12+
&& if [ ${CN_MIRROR} == true ] ; then \
1313
cp ./ngx_waf/docker/sources.list /etc/apt/sources.list ; \
1414
apt-get clean all ; \
1515
fi \
@@ -30,7 +30,7 @@ RUN set -xe \
3030
libgd-dev \
3131
libperl-dev \
3232
libcurl4-openssl-dev \
33-
python3 \
33+
python3-full \
3434
python3-pip \
3535
libtool \
3636
autoconf \
@@ -41,10 +41,10 @@ RUN set -xe \
4141
libmodsecurity3 \
4242
flex \
4343
bison \
44-
&& if [ ${CHANGE_SOURCE} == true ] ; then \
44+
&& if [ ${CN_MIRROR} == true ] ; then \
4545
pip3 config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple ; \
4646
fi \
47-
&& pip3 install lastversion
47+
&& pip3 install lastversion || pip3 install lastversion --break-system-packages
4848

4949
RUN set -xe \
5050
&& git clone -b v1.7.15 https://github.com/DaveGamble/cJSON.git ngx_waf/lib/cjson

docker/Dockerfile.musl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM owasp/modsecurity:3.0.5-alpine AS modsecurity
44

55
ARG NGX_VER=stable
66
FROM nginx:${NGX_VER}-alpine as base
7-
ARG CHANGE_SOURCE=false
7+
ARG CN_MIRROR=false
88
ARG NGX_VER=stable
99
ARG LIB_SODIUM_VER=1.0.18-RELEASE
1010
ARG MODSEC_VERSION=v3.0.5
@@ -17,7 +17,7 @@ COPY --from=modsecurity /usr/local/modsecurity/ /usr/local/modsecurity/
1717

1818
SHELL ["/bin/sh", "-o", "pipefail", "-c"]
1919
RUN set -xe \
20-
&& if [ ${CHANGE_SOURCE} = true ]; then \
20+
&& if [ ${CN_MIRROR} = true ]; then \
2121
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories ; \
2222
fi \
2323
&& apk update \
@@ -46,10 +46,10 @@ RUN set -xe \
4646
libmaxminddb \
4747
flex \
4848
bison \
49-
&& if [ ${CHANGE_SOURCE} = true ]; then \
49+
&& if [ ${CN_MIRROR} = true ]; then \
5050
pip3 config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple ; \
5151
fi \
52-
&& pip3 install lastversion
52+
&& pip3 install lastversion || pip3 install lastversion --break-system-packages
5353

5454
RUN set -xe \
5555
&& git clone https://github.com/DaveGamble/cJSON.git --branch ${CJSON_VERSION} ngx_waf/lib/cjson

0 commit comments

Comments
 (0)