Skip to content

Commit 5f1dec7

Browse files
committed
chore(CI): fix broken CI (#130)
1 parent 02dc08c commit 5f1dec7

File tree

5 files changed

+53
-33
lines changed

5 files changed

+53
-33
lines changed

.github/workflows/codecov.yml

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

3-
on: [push]
3+
on: [pull_request]
44

55
defaults:
66
run:
77
shell: bash
88

9+
# cancel previous runs if new commits are pushed to the PR, but run for each commit on master
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
13+
914
jobs:
1015
build_deps:
1116
name: Build dependencies
@@ -19,7 +24,7 @@ jobs:
1924
run: |
2025
echo "CACHE_ROOT=$HOME/cache-root" >> $GITHUB_ENV
2126
22-
- uses: actions/checkout@v2
27+
- uses: actions/checkout@v4
2328
with:
2429
ref: ${{ github.ref }}
2530

@@ -45,6 +50,9 @@ jobs:
4550
if: steps.cache-deps.outputs.cache-hit != 'true'
4651
run: |
4752
sudo apt-get --yes update
53+
# https://github.com/actions/runner-images/issues/2139
54+
sudo apt-get remove nginx-core nginx-full nginx-light nginx-extras
55+
sudo apt-get remove libgd3
4856
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
4957
5058
- name: Download and install ModSecurity
@@ -83,7 +91,7 @@ jobs:
8391
python-version: '3.x'
8492
architecture: 'x64'
8593

86-
- uses: actions/checkout@v2
94+
- uses: actions/checkout@v4
8795
with:
8896
ref: ${{ github.ref }}
8997

@@ -111,6 +119,9 @@ jobs:
111119
- name: Install dependencies
112120
run: |
113121
sudo apt-get --yes update
122+
# https://github.com/actions/runner-images/issues/2139
123+
sudo apt-get remove nginx-core nginx-full nginx-light nginx-extras
124+
sudo apt-get remove libgd3
114125
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
115126
116127
- 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: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: test
22

3-
on:
4-
push:
5-
branches:
3+
on:
64
pull_request:
75
schedule:
86
- cron: '0 0 * * SUN'
@@ -13,6 +11,11 @@ defaults:
1311
run:
1412
shell: bash
1513

14+
# cancel previous runs if new commits are pushed to the PR, but run for each commit on master
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
17+
cancel-in-progress: true
18+
1619
jobs:
1720
self-trigger:
1821
runs-on: ubuntu-latest
@@ -43,7 +46,7 @@ jobs:
4346
run: |
4447
echo "CACHE_ROOT=$HOME/cache-root" >> $GITHUB_ENV
4548
46-
- uses: actions/checkout@v2
49+
- uses: actions/checkout@v4
4750
with:
4851
ref: ${{ github.ref }}
4952

@@ -69,6 +72,9 @@ jobs:
6972
if: steps.cache-deps.outputs.cache-hit != 'true'
7073
run: |
7174
sudo apt-get --yes update
75+
# https://github.com/actions/runner-images/issues/2139
76+
sudo apt-get remove nginx-core nginx-full nginx-light nginx-extras
77+
sudo apt-get remove libgd3
7278
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
7379
7480
- name: Download and install ModSecurity
@@ -115,7 +121,7 @@ jobs:
115121
python-version: '3.x'
116122
architecture: 'x64'
117123

118-
- uses: actions/checkout@v2
124+
- uses: actions/checkout@v4
119125
with:
120126
ref: ${{ github.ref }}
121127

@@ -143,6 +149,9 @@ jobs:
143149
- name: Install dependencies
144150
run: |
145151
sudo apt-get --yes update
152+
# https://github.com/actions/runner-images/issues/2139
153+
sudo apt-get remove nginx-core nginx-full nginx-light nginx-extras
154+
sudo apt-get remove libgd3
146155
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
147156
148157
- name: Download nginx-${{ matrix.nginx-version }}
@@ -222,21 +231,21 @@ jobs:
222231
version: ['stable', 'mainline']
223232
target: ['glibc', 'musl']
224233
steps:
225-
- uses: actions/checkout@v2
234+
- uses: actions/checkout@v4
226235
with:
227236
ref: ${{ github.ref }}
228237
- name: Set up QEMU
229-
uses: docker/setup-qemu-action@v1
238+
uses: docker/setup-qemu-action@v3
230239
- name: Set up Docker Buildx
231-
uses: docker/setup-buildx-action@v1
240+
uses: docker/setup-buildx-action@v3
232241
- name: Build module
233242
run: docker build --file docker/Dockerfile.${{ matrix.target }} --build-arg=NGX_VER=${{ matrix.version }} .
234243
triger:
235244
runs-on: ubuntu-latest
236245
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (github.ref == 'refs/heads/lts' || github.ref == 'refs/heads/current')) }}
237246
needs: ['native', 'docker']
238247
steps:
239-
- uses: actions/checkout@v2
248+
- uses: actions/checkout@v4
240249
with:
241250
ref: ${{ github.ref }}
242251
- 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)