forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:python/cpython into pythongh-102251
- Loading branch information
Showing
359 changed files
with
3,988 additions
and
30,375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ permissions: | |
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
@@ -37,8 +37,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
outputs: | ||
run-docs: ${{ steps.docs-changes.outputs.run-docs || false }} | ||
run_tests: ${{ steps.check.outputs.run_tests }} | ||
run_hypothesis: ${{ steps.check.outputs.run_hypothesis }} | ||
config_hash: ${{ steps.config_hash.outputs.hash }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Check for source changes | ||
|
@@ -74,6 +76,32 @@ jobs: | |
echo "Run hypothesis tests" | ||
echo "run_hypothesis=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Compute hash for config cache key | ||
id: config_hash | ||
run: | | ||
echo "hash=${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}" >> $GITHUB_OUTPUT | ||
- name: Get a list of the changed documentation-related files | ||
if: github.event_name == 'pull_request' | ||
id: changed-docs-files | ||
uses: Ana06/[email protected] | ||
with: | ||
filter: | | ||
Doc/** | ||
Misc/** | ||
.github/workflows/reusable-docs.yml | ||
- name: Check for docs changes | ||
if: >- | ||
github.event_name == 'pull_request' | ||
&& steps.changed-docs-files.outputs.added_modified_renamed != '' | ||
id: docs-changes | ||
run: | | ||
echo "run-docs=true" >> "${GITHUB_OUTPUT}" | ||
check-docs: | ||
name: Docs | ||
needs: check_source | ||
if: fromJSON(needs.check_source.outputs.run-docs) | ||
uses: ./.github/workflows/reusable-docs.yml | ||
|
||
check_generated_files: | ||
name: 'Check if generated files are up to date' | ||
|
@@ -83,6 +111,11 @@ jobs: | |
if: needs.check_source.outputs.run_tests == 'true' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Restore config.cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: config.cache | ||
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }} | ||
- uses: actions/setup-python@v3 | ||
- name: Install Dependencies | ||
run: sudo ./.github/workflows/posix-deps-apt.sh | ||
|
@@ -99,7 +132,7 @@ jobs: | |
- name: Configure CPython | ||
run: | | ||
# Build Python with the libpython dynamic library | ||
./configure --with-pydebug --enable-shared | ||
./configure --config-cache --with-pydebug --enable-shared | ||
- name: Regenerate autoconf files with container image | ||
run: make regen-configure | ||
- name: Build CPython | ||
|
@@ -180,6 +213,11 @@ jobs: | |
PYTHONSTRICTEXTENSIONBUILD: 1 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Restore config.cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: config.cache | ||
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }} | ||
- name: Install Homebrew dependencies | ||
run: brew install pkg-config [email protected] xz gdbm tcl-tk | ||
- name: Configure CPython | ||
|
@@ -188,6 +226,7 @@ jobs: | |
LDFLAGS="-L$(brew --prefix gdbm)/lib -I$(brew --prefix xz)/lib" \ | ||
PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig" \ | ||
./configure \ | ||
--config-cache \ | ||
--with-pydebug \ | ||
--prefix=/opt/python-dev \ | ||
--with-openssl="$(brew --prefix [email protected])" | ||
|
@@ -240,9 +279,18 @@ jobs: | |
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR | ||
- name: Bind mount sources read-only | ||
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR | ||
- name: Restore config.cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache | ||
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }} | ||
- name: Configure CPython out-of-tree | ||
working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
run: ../cpython-ro-srcdir/configure --with-pydebug --with-openssl=$OPENSSL_DIR | ||
run: | | ||
../cpython-ro-srcdir/configure \ | ||
--config-cache \ | ||
--with-pydebug \ | ||
--with-openssl=$OPENSSL_DIR | ||
- name: Build CPython out-of-tree | ||
working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
run: make -j4 | ||
|
@@ -273,6 +321,11 @@ jobs: | |
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Restore config.cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: config.cache | ||
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }} | ||
- name: Register gcc problem matcher | ||
run: echo "::add-matcher::.github/problem-matchers/gcc.json" | ||
- name: Install Dependencies | ||
|
@@ -297,7 +350,7 @@ jobs: | |
- name: Configure ccache action | ||
uses: hendrikmuhs/[email protected] | ||
- name: Configure CPython | ||
run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR | ||
run: ./configure --config-cache --with-pydebug --with-openssl=$OPENSSL_DIR | ||
- name: Build CPython | ||
run: make -j4 | ||
- name: Display build info | ||
|
@@ -306,7 +359,7 @@ jobs: | |
run: ./python Lib/test/ssltests.py | ||
|
||
test_hypothesis: | ||
name: "Hypothesis Tests on Ubuntu" | ||
name: "Hypothesis tests on Ubuntu" | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 60 | ||
needs: check_source | ||
|
@@ -347,9 +400,18 @@ jobs: | |
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR | ||
- name: Bind mount sources read-only | ||
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR | ||
- name: Restore config.cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache | ||
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }} | ||
- name: Configure CPython out-of-tree | ||
working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
run: ../cpython-ro-srcdir/configure --with-pydebug --with-openssl=$OPENSSL_DIR | ||
run: | | ||
../cpython-ro-srcdir/configure \ | ||
--config-cache \ | ||
--with-pydebug \ | ||
--with-openssl=$OPENSSL_DIR | ||
- name: Build CPython out-of-tree | ||
working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
run: make -j4 | ||
|
@@ -417,6 +479,11 @@ jobs: | |
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Restore config.cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: config.cache | ||
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }} | ||
- name: Register gcc problem matcher | ||
run: echo "::add-matcher::.github/problem-matchers/gcc.json" | ||
- name: Install Dependencies | ||
|
@@ -445,7 +512,7 @@ jobs: | |
- name: Configure ccache action | ||
uses: hendrikmuhs/[email protected] | ||
- name: Configure CPython | ||
run: ./configure --with-address-sanitizer --without-pymalloc | ||
run: ./configure --config-cache --with-address-sanitizer --without-pymalloc | ||
- name: Build CPython | ||
run: make -j4 | ||
- name: Display build info | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 1 addition & 24 deletions
25
.github/workflows/doc.yml → .github/workflows/reusable-docs.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.