Skip to content

Commit d4187d7

Browse files
committed
Update tests
1 parent 134fc24 commit d4187d7

4 files changed

Lines changed: 16 additions & 11 deletions

File tree

.github/workflows/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ on:
99
paths:
1010
- '**.sh'
1111
- '.github/workflows/main.yml'
12+
- '.github/workflows/test_set_1.yml'
1213
- '.github/workflows/test_set_2.yml'
1314
- '.github/workflows/test_set_3.yml'
1415

1516
jobs:
17+
test_set_1:
18+
if: github.repository_owner == 'hwdsl2'
19+
uses: ./.github/workflows/test_set_1.yml
20+
1621
test_set_2:
1722
if: github.repository_owner == 'hwdsl2'
1823
uses: ./.github/workflows/test_set_2.yml

.github/workflows/test_set_1.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
if: github.repository_owner == 'hwdsl2'
1212
strategy:
1313
matrix:
14-
os_version: ["centos:9s", "rockylinux:8", "almalinux:9", "almalinux:8"]
14+
os_version: ["centos:10s", "centos:9s", "rockylinux:8", "almalinux:10", "almalinux:9", "almalinux:8"]
1515
fail-fast: false
1616
env:
1717
OS_VERSION: ${{ matrix.os_version }}
@@ -41,7 +41,9 @@ jobs:
4141
}
4242
4343
cd /opt/src
44-
yum -y -q update
44+
if grep -qs -i rocky /etc/redhat-release; then
45+
yum -y -q update
46+
fi
4547
yum -y -q install wget kmod procps-ng net-tools
4648
rm -f /usr/bin/systemd-detect-virt
4749
@@ -143,6 +145,8 @@ jobs:
143145
144146
if [ "$OS_VERSION" = "centos:9s" ]; then
145147
echo "FROM quay.io/centos/centos:stream9" > Dockerfile
148+
elif [ "$OS_VERSION" = "centos:10s" ]; then
149+
echo "FROM quay.io/centos/centos:stream10" > Dockerfile
146150
elif [ "$OS_VERSION" = "centos:8s" ]; then
147151
echo "FROM quay.io/centos/centos:stream8" > Dockerfile
148152
else
@@ -151,17 +155,15 @@ jobs:
151155
152156
cat >> Dockerfile <<'EOF'
153157
154-
ENV container docker
158+
ENV container=docker
155159
WORKDIR /opt/src
156-
157160
EOF
158161
159-
if [ "$OS_VERSION" = "centos:9s" ]; then
162+
if [ "$OS_VERSION" = "centos:9s" ] || [ "$OS_VERSION" = "centos:10s" ]; then
160163
echo "RUN yum -y -q install systemd" >> Dockerfile
161164
fi
162165
163166
cat >> Dockerfile <<'EOF'
164-
165167
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ "$i" = \
166168
systemd-tmpfiles-setup.service ] || rm -f "$i"; done); \
167169
rm -f /lib/systemd/system/multi-user.target.wants/*; \
@@ -186,8 +188,8 @@ jobs:
186188
187189
- name: Test
188190
run: |
189-
docker run -d --name "${OS_VERSION//:}-test-1" -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
190-
--privileged "${OS_VERSION//:}-test"
191+
docker run -d --name "${OS_VERSION//:}-test-1" -v /sys/fs/cgroup:/sys/fs/cgroup:rw \
192+
--cgroupns=host --privileged "${OS_VERSION//:}-test"
191193
sleep 5
192194
docker exec "${OS_VERSION//:}-test-1" /opt/src/run.sh "${OS_VERSION::6}"
193195
@@ -196,4 +198,4 @@ jobs:
196198
run: |
197199
rm -rf "$GITHUB_WORKSPACE/testing/${OS_VERSION//:}"
198200
docker rm -f "${OS_VERSION//:}-test-1" || true
199-
docker rmi "${OS_VERSION//:}-test" || true
201+
docker rmi "${OS_VERSION//:}-test" || true

.github/workflows/test_set_2.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
3131
export DEBIAN_FRONTEND=noninteractive
3232
apt-get -yqq update
33-
apt-get -yqq dist-upgrade
3433
apt-get -yqq install wget kmod procps net-tools
3534
3635
cp -f "$GITHUB_WORKSPACE"/wireguard-install.sh ./wireguard.sh

.github/workflows/test_set_3.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
2828
export DEBIAN_FRONTEND=noninteractive
2929
sudo apt-get -yqq update
30-
sudo apt-get -yqq dist-upgrade
3130
sudo apt-get -yqq install wget
3231
3332
cp -f "$GITHUB_WORKSPACE"/wireguard-install.sh ./wireguard.sh

0 commit comments

Comments
 (0)