forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (109 loc) · 3.64 KB
/
build.yml
File metadata and controls
129 lines (109 loc) · 3.64 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
name: Tests
# Cancel in-progress runs for the same PR.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
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 --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo "run_tests=true" >> "$GITHUB_OUTPUT" || true
fi
opensuse-tests:
name: '${{ matrix.name }} (openSUSE Leap)'
runs-on: ubuntu-latest
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
# Use a specific image version for reproducible builds
container:
image: opensuse/leap:15.6
strategy:
fail-fast: false
matrix:
include:
- name: 'Check ABI'
task: 'abi'
- name: 'Check Generated Files'
task: 'generated-files'
- name: 'Build and Test'
task: 'build-and-test'
env:
OPENSSL_VER: 1.1.1u
steps:
- name: Install Git and Tar
run: |
zypper ref
zypper -n install -y git-core tar
- uses: actions/checkout@v4
- name: Install All Dependencies
run: sh -x ./.github/workflows/posix-deps-zypp.sh
- name: 'Restore OpenSSL build'
if: matrix.task == 'build-and-test'
id: cache-openssl
uses: actions/cache@v4
with:
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
key: opensuse-leap-multissl-openssl-${{ env.OPENSSL_VER }}
# === Steps for ABI Check ===
- name: Build CPython for ABI Check
if: matrix.task == 'abi'
env:
CFLAGS: -g3 -O0
run: |
./configure --enable-shared --with-fpectl
make -j4
- name: Check for changes in the ABI
if: matrix.task == 'abi'
run: make check-abidump
# === Steps for Generated Files Check ===
- name: Build CPython for Generated Files Check
# if: matrix.task == 'generated-files'
if: false
run: |
./configure --with-pydebug
make -j4 regen-all
- name: Check for changes in generated files
# if: matrix.task == 'generated-files'
if: false
run: |
if ! git diff --quiet; then
echo "Generated files are not up to date. Please run 'make regen-all' and commit the changes."
git status
git diff
exit 1
fi
- name: Check exported libpython symbols
# if: matrix.task == 'generated-files'
if: false
run: make smelly
# === Steps for Full Build and Test ===
- name: Install OpenSSL
if: matrix.task == 'build-and-test' && 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
if: matrix.task == 'build-and-test'
run: ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER
- name: Build CPython
if: matrix.task == 'build-and-test'
run: make -j4
- name: Display build info
if: matrix.task == 'build-and-test'
run: make pythoninfo
- name: Run tests
if: matrix.task == 'build-and-test'
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"