Skip to content

Commit 8192db7

Browse files
committed
ci: add GitHub Actions to test current branch
1 parent 8f56b7d commit 8192db7

14 files changed

+15119
-77
lines changed

.github/CODEOWNERS

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# See https://help.github.com/articles/about-codeowners/
2+
# for more info about CODEOWNERS file
3+
4+
# It uses the same pattern rule for gitignore file
5+
# https://git-scm.com/docs/gitignore#_pattern_format
6+
7+
# asyncio
8+
**/*asyncio* @1st1 @asvetlov
9+
10+
# Core
11+
**/*context* @1st1
12+
**/*genobject* @1st1
13+
**/*hamt* @1st1
14+
15+
# Hashing
16+
**/*hashlib* @python/crypto-team
17+
**/*pyhash* @python/crypto-team
18+
19+
# Import (including importlib).
20+
# Ignoring importlib.h so as to not get flagged on
21+
# all pull requests that change the emitted
22+
# bytecode.
23+
**/*import*.c @python/import-team
24+
**/*import*.py @python/import-team
25+
26+
27+
# SSL
28+
**/*ssl* @python/crypto-team
29+
30+
# CSPRNG
31+
Python/bootstrap_hash.c @python/crypto-team
32+
33+
# Email and related
34+
**/*mail* @python/email-team
35+
**/*smtp* @python/email-team
36+
**/*mime* @python/email-team
37+
**/*imap* @python/email-team
38+
**/*poplib* @python/email-team
39+
40+
# subprocess
41+
**/*subprocess* @gpshead
42+
43+
# Windows
44+
/PC/ @python/windows-team
45+
/PCbuild/ @python/windows-team
46+
47+
# Windows installer packages
48+
/Tools/msi/ @python/windows-team
49+
/Tools/nuget/ @python/windows-team
50+
51+
**/*itertools* @rhettinger
52+
**/*collections* @rhettinger
53+
**/*random* @rhettinger
54+
**/*queue* @rhettinger
55+
**/*bisect* @rhettinger
56+
**/*heapq* @rhettinger
57+
**/*functools* @ncoghlan @rhettinger
58+
**/*decimal* @rhettinger @skrah
59+
60+
**/*dataclasses* @ericvsmith
61+
62+
**/*idlelib* @terryjreedy
63+
64+
**/*typing* @gvanrossum @ilevkivskyi

.github/CONTRIBUTING.rst

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
Contributing to Python
2+
======================
3+
4+
Build Status
5+
------------
6+
7+
- master
8+
9+
+ `Stable buildbots <http://buildbot.python.org/3.x.stable/>`_
10+
11+
- 3.7
12+
13+
+ `Stable buildbots <http://buildbot.python.org/3.7.stable/>`_
14+
15+
- 3.6
16+
17+
+ `Stable buildbots <http://buildbot.python.org/3.6.stable/>`_
18+
19+
- 2.7
20+
21+
+ `Stable buildbots <http://buildbot.python.org/2.7.stable/>`_
22+
23+
24+
Thank You
25+
---------
26+
First off, thanks for contributing to the maintenance of the Python programming
27+
language and the CPython interpreter! Even if your contribution is not
28+
ultimately accepted, the fact you put time and effort into helping out is
29+
greatly appreciated.
30+
31+
32+
Contribution Guidelines
33+
-----------------------
34+
Please read the `devguide <https://devguide.python.org/>`_ for
35+
guidance on how to contribute to this project. The documentation covers
36+
everything from how to build the code to submitting a pull request. There are
37+
also suggestions on how you can most effectively help the project.
38+
39+
Please be aware that our workflow does deviate slightly from the typical GitHub
40+
project. Details on how to properly submit a pull request are covered in
41+
`Lifecycle of a Pull Request <https://devguide.python.org/pullrequest/>`_.
42+
We utilize various bots and status checks to help with this, so do follow the
43+
comments they leave and their "Details" links, respectively. The key points of
44+
our workflow that are not covered by a bot or status check are:
45+
46+
- All discussions that are not directly related to the code in the pull request
47+
should happen on bugs.python.org
48+
- Upon your first non-trivial pull request (which includes documentation changes),
49+
feel free to add yourself to ``Misc/ACKS``
50+
51+
52+
Setting Expectations
53+
--------------------
54+
Due to the fact that this project is entirely volunteer-run (i.e. no one is paid
55+
to work on Python full-time), we unfortunately can make no guarantees as to if
56+
or when a core developer will get around to reviewing your pull request.
57+
If no core developer has done a review or responded to changes made because of a
58+
"changes requested" review, please feel free to email python-dev to ask if
59+
someone could take a look at your pull request.
60+
61+
62+
Code of Conduct
63+
---------------
64+
All interactions for this project are covered by the
65+
`PSF Code of Conduct <https://www.python.org/psf/codeofconduct/>`_. Everyone is
66+
expected to be open, considerate, and respectful of others no matter their
67+
position within the project.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
## CPython Mirror
1+
!!! If this is a backport PR (PR made against branches other than `master`),
2+
please ensure that the PR title is in the following format:
23

3-
https://github.com/python/cpython is a cpython mirror repository. Pull requests
4-
are not accepted on this repo and will be automatically closed.
4+
```
5+
[X.Y] <title from the original PR> (GH-NNNN)
6+
```
57

6-
### Submit patches at https://bugs.python.org
8+
Where: [X.Y] is the branch name, e.g. [3.7].
79

8-
For additional information about contributing to CPython, see the
9-
[developer's guide](https://docs.python.org/devguide/#contributing).
10+
GH-NNNN refers to the PR number from `master`.
11+
12+
PLEASE: Remove this headline!!!

.github/appveyor.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/codecov.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Tests
2+
3+
# Cancel in-progress runs for the same PR.
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
6+
cancel-in-progress: true
7+
8+
on:
9+
pull_request:
10+
11+
jobs:
12+
check_source:
13+
name: 'Check for source changes'
14+
runs-on: ubuntu-latest
15+
outputs:
16+
run_tests: ${{ steps.check.outputs.run_tests }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 1000
21+
- name: Check for source changes
22+
id: check
23+
run: |
24+
if [ -z "$GITHUB_BASE_REF" ]; then
25+
echo "run_tests=true" >> "$GITHUB_OUTPUT"
26+
else
27+
git fetch origin $GITHUB_BASE_REF --depth=1
28+
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo "run_tests=true" >> "$GITHUB_OUTPUT" || true
29+
fi
30+
31+
opensuse-tests:
32+
name: '${{ matrix.name }} (openSUSE Leap)'
33+
runs-on: ubuntu-latest
34+
needs: check_source
35+
if: needs.check_source.outputs.run_tests == 'true'
36+
# Use a specific image version for reproducible builds
37+
container:
38+
image: opensuse/leap:15.6
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
include:
43+
- name: 'Check ABI'
44+
task: 'abi'
45+
- name: 'Check Generated Files'
46+
task: 'generated-files'
47+
- name: 'Build and Test'
48+
task: 'build-and-test'
49+
50+
env:
51+
OPENSSL_VER: 1.1.1u
52+
53+
steps:
54+
55+
- name: Install Git and Tar
56+
run: |
57+
zypper ref
58+
zypper -n install -y git-core tar
59+
60+
- uses: actions/checkout@v4
61+
62+
- name: Install All Dependencies
63+
run: sh -x ./.github/workflows/posix-deps-zypp.sh
64+
65+
- name: 'Restore OpenSSL build'
66+
if: matrix.task == 'build-and-test'
67+
id: cache-openssl
68+
uses: actions/cache@v4
69+
with:
70+
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
71+
key: opensuse-leap-multissl-openssl-${{ env.OPENSSL_VER }}
72+
73+
# === Steps for ABI Check ===
74+
- name: Build CPython for ABI Check
75+
if: matrix.task == 'abi'
76+
env:
77+
CFLAGS: -g3 -O0
78+
run: |
79+
./configure --enable-shared --with-fpectl
80+
make -j4
81+
82+
- name: Check for changes in the ABI
83+
if: matrix.task == 'abi'
84+
run: make check-abidump
85+
86+
# === Steps for Generated Files Check ===
87+
- name: Build CPython for Generated Files Check
88+
# if: matrix.task == 'generated-files'
89+
if: false
90+
run: |
91+
./configure --with-pydebug
92+
make -j4 regen-all
93+
94+
- name: Check for changes in generated files
95+
# if: matrix.task == 'generated-files'
96+
if: false
97+
run: |
98+
if ! git diff --quiet; then
99+
echo "Generated files are not up to date. Please run 'make regen-all' and commit the changes."
100+
git status
101+
git diff
102+
exit 1
103+
fi
104+
105+
- name: Check exported libpython symbols
106+
# if: matrix.task == 'generated-files'
107+
if: false
108+
run: make smelly
109+
110+
# === Steps for Full Build and Test ===
111+
- name: Install OpenSSL
112+
if: matrix.task == 'build-and-test' && steps.cache-openssl.outputs.cache-hit != 'true'
113+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux
114+
115+
- name: Configure CPython
116+
if: matrix.task == 'build-and-test'
117+
run: ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER
118+
119+
- name: Build CPython
120+
if: matrix.task == 'build-and-test'
121+
run: make -j4
122+
123+
- name: Display build info
124+
if: matrix.task == 'build-and-test'
125+
run: make pythoninfo
126+
127+
- name: Run tests
128+
if: matrix.task == 'build-and-test'
129+
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"

0 commit comments

Comments
 (0)