Skip to content

Commit 3356118

Browse files
committed
Run steps inside opensuse/leap Docker container
1 parent 3aa1b79 commit 3356118

File tree

4 files changed

+91
-60
lines changed

4 files changed

+91
-60
lines changed

.github/workflows/build.yml

Lines changed: 70 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: Tests
22

3-
# bpo-40548: "paths-ignore" is not used to skip documentation-only PRs, because
4-
# it prevents to mark a job as mandatory. A PR cannot be merged if a job is
5-
# mandatory but not scheduled because of "paths-ignore".
63
on:
74
pull_request:
85

@@ -13,44 +10,46 @@ jobs:
1310
outputs:
1411
run_tests: ${{ steps.check.outputs.run_tests }}
1512
steps:
16-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1714
with:
1815
fetch-depth: 1000
1916
- name: Check for source changes
2017
id: check
2118
run: |
2219
if [ -z "$GITHUB_BASE_REF" ]; then
23-
echo '::set-output name=run_tests::true'
20+
echo "run_tests=true" >> "$GITHUB_OUTPUT"
2421
else
2522
git fetch origin $GITHUB_BASE_REF --depth=1
26-
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more
27-
# reliable than git diff "origin/$GITHUB_BASE_REF.." (2 dots),
28-
# but it requires to download more commits (this job uses
29-
# "git fetch --depth=1").
30-
#
31-
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) works with Git
32-
# 2.26, but Git 2.28 is stricter and fails with "no merge base".
33-
#
34-
# git diff "origin/$GITHUB_BASE_REF.." (2 dots) should be enough on
35-
# GitHub, since GitHub starts by merging origin/$GITHUB_BASE_REF
36-
# into the PR branch anyway.
37-
#
38-
# https://github.com/python/core-workflow/issues/373
39-
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
23+
# git diff using 2 dots should be enough on GitHub.
24+
# See https://github.com/python/core-workflow/issues/373
25+
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo "run_tests=true" >> "$GITHUB_OUTPUT" || true
4026
fi
4127
42-
check_abi:
43-
name: 'Check if the ABI has changed'
44-
runs-on: ubuntu-20.04
28+
check_abi_opensuse:
29+
name: 'Check ABI (openSUSE Leap)'
30+
runs-on: ubuntu-latest
4531
needs: check_source
4632
if: needs.check_source.outputs.run_tests == 'true'
33+
container:
34+
image: opensuse/leap:latest
4735
steps:
48-
- uses: actions/checkout@v2
49-
- uses: actions/setup-python@v2
36+
- uses: actions/checkout@v4
5037
- name: Install Dependencies
5138
run: |
52-
sudo ./.github/workflows/posix-deps-apt.sh
53-
sudo apt-get install -yq abigail-tools
39+
zypper --non-interactive install --auto-agree-with-licenses \
40+
gcc \
41+
make \
42+
libabigail-tools \
43+
libffi-devel \
44+
zlib-devel \
45+
ncurses-devel \
46+
gdbm-devel \
47+
sqlite3-devel \
48+
tk-devel \
49+
readline-devel \
50+
xz-devel \
51+
bzip2 \
52+
openssl
5453
- name: Build CPython
5554
env:
5655
CFLAGS: -g3 -O0
@@ -61,16 +60,31 @@ jobs:
6160
- name: Check for changes in the ABI
6261
run: make check-abidump
6362

64-
check_generated_files:
65-
name: 'Check if generated files are up to date'
63+
check_generated_files_opensuse:
64+
name: 'Check generated files (openSUSE Leap)'
6665
runs-on: ubuntu-latest
6766
needs: check_source
6867
if: needs.check_source.outputs.run_tests == 'true'
68+
container:
69+
image: opensuse/leap:latest
6970
steps:
70-
- uses: actions/checkout@v2
71-
- uses: actions/setup-python@v2
71+
- uses: actions/checkout@v4
7272
- name: Install Dependencies
73-
run: sudo ./.github/workflows/posix-deps-apt.sh
73+
run: |
74+
zypper --non-interactive install --auto-agree-with-licenses \
75+
gcc \
76+
make \
77+
tar \
78+
libffi-devel \
79+
zlib-devel \
80+
ncurses-devel \
81+
gdbm-devel \
82+
sqlite3-devel \
83+
tk-devel \
84+
readline-devel \
85+
xz-devel \
86+
bzip2 \
87+
openssl
7488
- name: Build CPython
7589
run: |
7690
./configure --with-pydebug
@@ -88,23 +102,41 @@ jobs:
88102
- name: Check exported libpython symbols
89103
run: make smelly
90104

91-
build_ubuntu:
92-
name: 'Ubuntu'
93-
runs-on: ubuntu-20.04
105+
build_opensuse:
106+
name: 'Build and Test (openSUSE Leap)'
107+
runs-on: ubuntu-latest # The host runner is still Ubuntu
94108
needs: check_source
95109
if: needs.check_source.outputs.run_tests == 'true'
110+
container:
111+
image: opensuse/leap:latest # But steps run inside this container
96112
env:
97113
OPENSSL_VER: 1.1.1u
98114
steps:
99-
- uses: actions/checkout@v2
115+
- uses: actions/checkout@v4
100116
- name: Install Dependencies
101-
run: sudo ./.github/workflows/posix-deps-apt.sh
117+
run: |
118+
zypper --non-interactive install --auto-agree-with-licenses \
119+
gcc \
120+
make \
121+
tar \
122+
python3 \
123+
xorg-x11-server-Xvfb \
124+
libffi-devel \
125+
zlib-devel \
126+
ncurses-devel \
127+
gdbm-devel \
128+
sqlite3-devel \
129+
tk-devel \
130+
readline-devel \
131+
xz-devel \
132+
bzip2
102133
- name: 'Restore OpenSSL build'
103134
id: cache-openssl
104135
uses: actions/cache@v4
105136
with:
106137
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
107-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
138+
# Updated key to be specific to the OS distribution
139+
key: opensuse-leap-multissl-openssl-${{ env.OPENSSL_VER }}
108140
- name: Install OpenSSL
109141
if: steps.cache-openssl.outputs.cache-hit != 'true'
110142
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux
@@ -115,4 +147,4 @@ jobs:
115147
- name: Display build info
116148
run: make pythoninfo
117149
- name: Tests
118-
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
150+
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"

.github/workflows/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v2
2222
- name: 'Install Dependencies'
23-
run: sudo ./.github/workflows/posix-deps-apt.sh && sudo apt-get install wamerican
23+
run: sudo ./.github/workflows/posix-deps-zypp.sh && sudo apt-get install wamerican
2424
- name: 'Configure CPython'
2525
run: ./configure --with-pydebug
2626
- name: 'Build CPython'

.github/workflows/posix-deps-apt.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
zypper refresh --force
3+
4+
zypper install --auto-agree-with-licenses --force \
5+
pattern:devel_rpm_build pattern:devel_C_C++ \
6+
zlib-devel \
7+
libbz2-devel \
8+
ncurses-devel \
9+
readline6-devel \
10+
sqlite3-devel \
11+
openssl-devel \
12+
gdbm-devel \
13+
tk-devel \
14+
lzma \
15+
lzma-devel \
16+
liblzma-devel \
17+
libffi-devel \
18+
uuid-devel \
19+
xvfb \
20+
lcov

0 commit comments

Comments
 (0)