forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (143 loc) · 4.48 KB
/
build.yml
File metadata and controls
148 lines (143 loc) · 4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Tests
on:
pull_request:
jobs:
check_source:
name: 'Check for source changes'
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.check.outputs.run_tests }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1000
- name: Check for source changes
id: check
run: |
if [ -z "$GITHUB_BASE_REF" ]; then
echo "run_tests=true" >> "$GITHUB_OUTPUT"
else
git fetch origin $GITHUB_BASE_REF --depth=1
# git diff using 2 dots should be enough on GitHub.
# See https://github.com/python/core-workflow/issues/373
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo "run_tests=true" >> "$GITHUB_OUTPUT" || true
fi
check_abi_opensuse:
name: 'Check ABI (openSUSE Leap)'
runs-on: ubuntu-latest
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
container:
image: opensuse/leap:latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
zypper --non-interactive install --auto-agree-with-licenses \
gcc \
make \
libabigail-tools \
libffi-devel \
zlib-devel \
ncurses-devel \
gdbm-devel \
sqlite3-devel \
tk-devel \
readline-devel \
xz-devel \
bzip2 \
openssl
- name: Build CPython
env:
CFLAGS: -g3 -O0
run: |
# Build Python with the libpython dynamic library
./configure --enable-shared
make -j4
- name: Check for changes in the ABI
run: make check-abidump
check_generated_files_opensuse:
name: 'Check generated files (openSUSE Leap)'
runs-on: ubuntu-latest
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
container:
image: opensuse/leap:latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
zypper --non-interactive install --auto-agree-with-licenses \
gcc \
make \
libffi-devel \
zlib-devel \
ncurses-devel \
gdbm-devel \
sqlite3-devel \
tk-devel \
readline-devel \
xz-devel \
bzip2 \
openssl
- name: Build CPython
run: |
./configure --with-pydebug
make -j4 regen-all
- name: Check for changes
run: |
changes=$(git status --porcelain)
# Check for changes in regenerated files
if ! test -z "$changes"
then
echo "Generated files not up to date. Perhaps you forgot to run make regen-all ;)"
echo "$changes"
exit 1
fi
- name: Check exported libpython symbols
run: make smelly
build_opensuse:
name: 'Build and Test (openSUSE Leap)'
runs-on: ubuntu-latest # The host runner is still Ubuntu
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
container:
image: opensuse/leap:latest # But steps run inside this container
env:
OPENSSL_VER: 1.1.1u
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
zypper --non-interactive install --auto-agree-with-licenses \
gcc \
make \
python3 \
xorg-x11-server-Xvfb \
libffi-devel \
zlib-devel \
ncurses-devel \
gdbm-devel \
sqlite3-devel \
tk-devel \
readline-devel \
xz-devel \
bzip2
- name: 'Restore OpenSSL build'
id: cache-openssl
uses: actions/cache@v4
with:
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
# Updated key to be specific to the OS distribution
key: opensuse-leap-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux
- name: Configure CPython
run: ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER
- name: Build CPython
run: make -j4
- name: Display build info
run: make pythoninfo
- name: Tests
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"