Lint GitHub Actions and Dependabot (#126002)

This commit is contained in:
Hugo van Kemenade 2024-10-28 20:59:35 +02:00 committed by GitHub
parent ced2691de4
commit e1190c0543
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 85 additions and 67 deletions

View File

@ -59,7 +59,7 @@ jobs:
with: with:
fetch-depth: 1 fetch-depth: 1
- name: Runner image version - name: Runner image version
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
- name: Check Autoconf and aclocal versions - name: Check Autoconf and aclocal versions
run: | run: |
grep "Generated by GNU Autoconf 2.71" configure grep "Generated by GNU Autoconf 2.71" configure
@ -98,7 +98,7 @@ jobs:
with: with:
python-version: '3.x' python-version: '3.x'
- name: Runner image version - name: Runner image version
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
- name: Restore config.cache - name: Restore config.cache
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
@ -108,7 +108,7 @@ jobs:
- name: Install Dependencies - name: Install Dependencies
run: sudo ./.github/workflows/posix-deps-apt.sh run: sudo ./.github/workflows/posix-deps-apt.sh
- name: Add ccache to PATH - name: Add ccache to PATH
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
- name: Configure ccache action - name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1.2 uses: hendrikmuhs/ccache-action@v1.2
with: with:
@ -247,7 +247,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Runner image version - name: Runner image version
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
- name: Restore config.cache - name: Restore config.cache
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
@ -259,9 +259,9 @@ jobs:
run: sudo ./.github/workflows/posix-deps-apt.sh run: sudo ./.github/workflows/posix-deps-apt.sh
- name: Configure OpenSSL env vars - name: Configure OpenSSL env vars
run: | run: |
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
- name: 'Restore OpenSSL build' - name: 'Restore OpenSSL build'
id: cache-openssl id: cache-openssl
uses: actions/cache@v4 uses: actions/cache@v4
@ -270,16 +270,16 @@ jobs:
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }} key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL - name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true' if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
- name: Add ccache to PATH - name: Add ccache to PATH
run: | run: |
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
- name: Configure ccache action - name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1.2 uses: hendrikmuhs/ccache-action@v1.2
with: with:
save: false save: false
- name: Configure CPython - name: Configure CPython
run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl=$OPENSSL_DIR run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl="$OPENSSL_DIR"
- name: Build CPython - name: Build CPython
run: make -j4 run: make -j4
- name: Display build info - name: Display build info
@ -312,9 +312,9 @@ jobs:
run: sudo ./.github/workflows/posix-deps-apt.sh run: sudo ./.github/workflows/posix-deps-apt.sh
- name: Configure OpenSSL env vars - name: Configure OpenSSL env vars
run: | run: |
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
- name: 'Restore OpenSSL build' - name: 'Restore OpenSSL build'
id: cache-openssl id: cache-openssl
uses: actions/cache@v4 uses: actions/cache@v4
@ -323,24 +323,24 @@ jobs:
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }} key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL - name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true' if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
- name: Add ccache to PATH - name: Add ccache to PATH
run: | run: |
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
- name: Configure ccache action - name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1.2 uses: hendrikmuhs/ccache-action@v1.2
with: with:
save: false save: false
- name: Setup directory envs for out-of-tree builds - name: Setup directory envs for out-of-tree builds
run: | run: |
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV echo "CPYTHON_BUILDDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-builddir)" >> "$GITHUB_ENV"
- name: Create directories for read-only out-of-tree builds - name: Create directories for read-only out-of-tree builds
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR run: mkdir -p "$CPYTHON_RO_SRCDIR" "$CPYTHON_BUILDDIR"
- name: Bind mount sources read-only - name: Bind mount sources read-only
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
- name: Runner image version - name: Runner image version
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
- name: Restore config.cache - name: Restore config.cache
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
@ -353,7 +353,7 @@ jobs:
--config-cache \ --config-cache \
--with-pydebug \ --with-pydebug \
--enable-slower-safety \ --enable-slower-safety \
--with-openssl=$OPENSSL_DIR --with-openssl="$OPENSSL_DIR"
- name: Build CPython out-of-tree - name: Build CPython out-of-tree
working-directory: ${{ env.CPYTHON_BUILDDIR }} working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: make -j4 run: make -j4
@ -362,18 +362,18 @@ jobs:
run: make pythoninfo run: make pythoninfo
- name: Remount sources writable for tests - name: Remount sources writable for tests
# some tests write to srcdir, lack of pyc files slows down testing # some tests write to srcdir, lack of pyc files slows down testing
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw run: sudo mount "$CPYTHON_RO_SRCDIR" -oremount,rw
- name: Setup directory envs for out-of-tree builds - name: Setup directory envs for out-of-tree builds
run: | run: |
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV echo "CPYTHON_BUILDDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-builddir)" >> "$GITHUB_ENV"
- name: "Create hypothesis venv" - name: "Create hypothesis venv"
working-directory: ${{ env.CPYTHON_BUILDDIR }} working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: | run: |
VENV_LOC=$(realpath -m .)/hypovenv VENV_LOC=$(realpath -m .)/hypovenv
VENV_PYTHON=$VENV_LOC/bin/python VENV_PYTHON=$VENV_LOC/bin/python
echo "HYPOVENV=${VENV_LOC}" >> $GITHUB_ENV echo "HYPOVENV=${VENV_LOC}" >> "$GITHUB_ENV"
echo "VENV_PYTHON=${VENV_PYTHON}" >> $GITHUB_ENV echo "VENV_PYTHON=${VENV_PYTHON}" >> "$GITHUB_ENV"
./python -m venv $VENV_LOC && $VENV_PYTHON -m pip install -r ${GITHUB_WORKSPACE}/Tools/requirements-hypothesis.txt ./python -m venv "$VENV_LOC" && "$VENV_PYTHON" -m pip install -r "${GITHUB_WORKSPACE}/Tools/requirements-hypothesis.txt"
- name: 'Restore Hypothesis database' - name: 'Restore Hypothesis database'
id: cache-hypothesis-database id: cache-hypothesis-database
uses: actions/cache@v4 uses: actions/cache@v4
@ -411,10 +411,13 @@ jobs:
build_asan: build_asan:
name: 'Address sanitizer' name: 'Address sanitizer'
runs-on: ubuntu-22.04 runs-on: ${{ matrix.os }}
timeout-minutes: 60 timeout-minutes: 60
needs: check_source needs: check_source
if: needs.check_source.outputs.run_tests == 'true' if: needs.check_source.outputs.run_tests == 'true'
strategy:
matrix:
os: [ubuntu-22.04]
env: env:
OPENSSL_VER: 3.0.15 OPENSSL_VER: 3.0.15
PYTHONSTRICTEXTENSIONBUILD: 1 PYTHONSTRICTEXTENSIONBUILD: 1
@ -422,7 +425,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Runner image version - name: Runner image version
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
- name: Restore config.cache - name: Restore config.cache
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
@ -438,9 +441,9 @@ jobs:
version: 10 version: 10
- name: Configure OpenSSL env vars - name: Configure OpenSSL env vars
run: | run: |
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
- name: 'Restore OpenSSL build' - name: 'Restore OpenSSL build'
id: cache-openssl id: cache-openssl
uses: actions/cache@v4 uses: actions/cache@v4
@ -449,10 +452,10 @@ jobs:
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }} key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL - name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true' if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
- name: Add ccache to PATH - name: Add ccache to PATH
run: | run: |
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
- name: Configure ccache action - name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1.2 uses: hendrikmuhs/ccache-action@v1.2
with: with:

View File

@ -65,9 +65,9 @@ jobs:
id: check id: check
run: | run: |
if [ -z "$GITHUB_BASE_REF" ]; then if [ -z "$GITHUB_BASE_REF" ]; then
echo "run-tests=true" >> $GITHUB_OUTPUT echo "run-tests=true" >> "$GITHUB_OUTPUT"
else else
git fetch origin $GITHUB_BASE_REF --depth=1 git fetch origin "$GITHUB_BASE_REF" --depth=1
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more # git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more
# reliable than git diff "origin/$GITHUB_BASE_REF.." (2 dots), # reliable than git diff "origin/$GITHUB_BASE_REF.." (2 dots),
# but it requires to download more commits (this job uses # but it requires to download more commits (this job uses
@ -81,18 +81,18 @@ jobs:
# into the PR branch anyway. # into the PR branch anyway.
# #
# https://github.com/python/core-workflow/issues/373 # https://github.com/python/core-workflow/issues/373
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc|^\.pre-commit-config\.yaml$|\.ruff\.toml$|\.md$|mypy\.ini$)' && echo "run-tests=true" >> $GITHUB_OUTPUT || true git diff --name-only "origin/$GITHUB_BASE_REF.." | grep -qvE '(\.rst$|^Doc|^Misc|^\.pre-commit-config\.yaml$|\.ruff\.toml$|\.md$|mypy\.ini$)' && echo "run-tests=true" >> "$GITHUB_OUTPUT" || true
fi fi
# Check if we should run hypothesis tests # Check if we should run hypothesis tests
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}} GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo $GIT_BRANCH echo "$GIT_BRANCH"
if $(echo "$GIT_BRANCH" | grep -q -w '3\.\(8\|9\|10\|11\)'); then if $(echo "$GIT_BRANCH" | grep -q -w '3\.\(8\|9\|10\|11\)'); then
echo "Branch too old for hypothesis tests" echo "Branch too old for hypothesis tests"
echo "run-hypothesis=false" >> $GITHUB_OUTPUT echo "run-hypothesis=false" >> "$GITHUB_OUTPUT"
else else
echo "Run hypothesis tests" echo "Run hypothesis tests"
echo "run-hypothesis=true" >> $GITHUB_OUTPUT echo "run-hypothesis=true" >> "$GITHUB_OUTPUT"
fi fi
# oss-fuzz maintains a configuration for fuzzing the main branch of # oss-fuzz maintains a configuration for fuzzing the main branch of
@ -100,19 +100,19 @@ jobs:
# merged into the main branch; compatibility with older branches may # merged into the main branch; compatibility with older branches may
# be broken. # be broken.
FUZZ_RELEVANT_FILES='(\.c$|\.h$|\.cpp$|^configure$|^\.github/workflows/build\.yml$|^Modules/_xxtestfuzz)' FUZZ_RELEVANT_FILES='(\.c$|\.h$|\.cpp$|^configure$|^\.github/workflows/build\.yml$|^Modules/_xxtestfuzz)'
if [ "$GITHUB_BASE_REF" = "main" ] && [ "$(git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qE $FUZZ_RELEVANT_FILES; echo $?)" -eq 0 ]; then if [ "$GITHUB_BASE_REF" = "main" ] && [ "$(git diff --name-only "origin/$GITHUB_BASE_REF.." | grep -qE $FUZZ_RELEVANT_FILES; echo $?)" -eq 0 ]; then
# The tests are pretty slow so they are executed only for PRs # The tests are pretty slow so they are executed only for PRs
# changing relevant files. # changing relevant files.
echo "Run CIFuzz tests" echo "Run CIFuzz tests"
echo "run-cifuzz=true" >> $GITHUB_OUTPUT echo "run-cifuzz=true" >> "$GITHUB_OUTPUT"
else else
echo "Branch too old for CIFuzz tests; or no C files were changed" echo "Branch too old for CIFuzz tests; or no C files were changed"
echo "run-cifuzz=false" >> $GITHUB_OUTPUT echo "run-cifuzz=false" >> "$GITHUB_OUTPUT"
fi fi
- name: Compute hash for config cache key - name: Compute hash for config cache key
id: config-hash id: config-hash
run: | run: |
echo "hash=${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}" >> $GITHUB_OUTPUT echo "hash=${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}" >> "$GITHUB_OUTPUT"
- name: Get a list of the changed documentation-related files - name: Get a list of the changed documentation-related files
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
id: changed-docs-files id: changed-docs-files

View File

@ -30,7 +30,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Runner image version - name: Runner image version
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
- name: Restore config.cache - name: Restore config.cache
uses: actions/cache@v4 uses: actions/cache@v4
with: with:

View File

@ -26,7 +26,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Runner image version - name: Runner image version
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
- name: Restore config.cache - name: Restore config.cache
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
@ -47,12 +47,12 @@ jobs:
sudo sysctl -w vm.mmap_rnd_bits=28 sudo sysctl -w vm.mmap_rnd_bits=28
- name: TSAN Option Setup - name: TSAN Option Setup
run: | run: |
echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/${{ inputs.suppressions_path }} handle_segv=0" >> $GITHUB_ENV echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/${{ inputs.suppressions_path }} handle_segv=0" >> "$GITHUB_ENV"
echo "CC=clang" >> $GITHUB_ENV echo "CC=clang" >> "$GITHUB_ENV"
echo "CXX=clang++" >> $GITHUB_ENV echo "CXX=clang++" >> "$GITHUB_ENV"
- name: Add ccache to PATH - name: Add ccache to PATH
run: | run: |
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
- name: Configure ccache action - name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1.2 uses: hendrikmuhs/ccache-action@v1.2
with: with:
@ -68,7 +68,7 @@ jobs:
run: ./python -m test --tsan -j4 run: ./python -m test --tsan -j4
- name: Display TSAN logs - name: Display TSAN logs
if: always() if: always()
run: find ${GITHUB_WORKSPACE} -name 'tsan_log.*' | xargs head -n 1000 run: find "${GITHUB_WORKSPACE}" -name 'tsan_log.*' | xargs head -n 1000
- name: Archive TSAN logs - name: Archive TSAN logs
if: always() if: always()
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

View File

@ -34,9 +34,9 @@ jobs:
run: sudo ./.github/workflows/posix-deps-apt.sh run: sudo ./.github/workflows/posix-deps-apt.sh
- name: Configure OpenSSL env vars - name: Configure OpenSSL env vars
run: | run: |
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
- name: 'Restore OpenSSL build' - name: 'Restore OpenSSL build'
id: cache-openssl id: cache-openssl
uses: actions/cache@v4 uses: actions/cache@v4
@ -45,10 +45,10 @@ jobs:
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }} key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL - name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true' if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
- name: Add ccache to PATH - name: Add ccache to PATH
run: | run: |
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
- name: Configure ccache action - name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1.2 uses: hendrikmuhs/ccache-action@v1.2
with: with:
@ -56,14 +56,14 @@ jobs:
max-size: "200M" max-size: "200M"
- name: Setup directory envs for out-of-tree builds - name: Setup directory envs for out-of-tree builds
run: | run: |
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV echo "CPYTHON_BUILDDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-builddir)" >> "$GITHUB_ENV"
- name: Create directories for read-only out-of-tree builds - name: Create directories for read-only out-of-tree builds
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR run: mkdir -p "$CPYTHON_RO_SRCDIR" "$CPYTHON_BUILDDIR"
- name: Bind mount sources read-only - name: Bind mount sources read-only
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
- name: Runner image version - name: Runner image version
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
- name: Restore config.cache - name: Restore config.cache
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
@ -77,7 +77,7 @@ jobs:
--with-pydebug --with-pydebug
--enable-slower-safety --enable-slower-safety
--enable-safety --enable-safety
--with-openssl=$OPENSSL_DIR --with-openssl="$OPENSSL_DIR"
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }} ${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
- name: Build CPython out-of-tree - name: Build CPython out-of-tree
if: ${{ inputs.free-threading }} if: ${{ inputs.free-threading }}
@ -95,14 +95,14 @@ jobs:
run: >- run: >-
python Tools/build/check_warnings.py python Tools/build/check_warnings.py
--compiler-output-file-path=${{ env.CPYTHON_BUILDDIR }}/compiler_output_ubuntu.txt --compiler-output-file-path=${{ env.CPYTHON_BUILDDIR }}/compiler_output_ubuntu.txt
--warning-ignore-file-path ${GITHUB_WORKSPACE}/Tools/build/.warningignore_ubuntu --warning-ignore-file-path "${GITHUB_WORKSPACE}/Tools/build/.warningignore_ubuntu"
--compiler-output-type=gcc --compiler-output-type=gcc
--fail-on-regression --fail-on-regression
--fail-on-improvement --fail-on-improvement
--path-prefix="../cpython-ro-srcdir/" --path-prefix="../cpython-ro-srcdir/"
- name: Remount sources writable for tests - name: Remount sources writable for tests
# some tests write to srcdir, lack of pyc files slows down testing # some tests write to srcdir, lack of pyc files slows down testing
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw run: sudo mount "$CPYTHON_RO_SRCDIR" -oremount,rw
- name: Tests - name: Tests
working-directory: ${{ env.CPYTHON_BUILDDIR }} working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: xvfb-run make test run: xvfb-run make test

View File

@ -43,7 +43,7 @@ jobs:
save: ${{ github.event_name == 'push' }} save: ${{ github.event_name == 'push' }}
max-size: "200M" max-size: "200M"
- name: "Add ccache to PATH" - name: "Add ccache to PATH"
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
- name: "Install Python" - name: "Install Python"
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:

View File

@ -1,6 +1,6 @@
repos: repos:
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.7 rev: v0.7.1
hooks: hooks:
- id: ruff - id: ruff
name: Run Ruff (lint) on Doc/ name: Run Ruff (lint) on Doc/
@ -24,7 +24,7 @@ repos:
files: ^Doc/ files: ^Doc/
- repo: https://github.com/psf/black-pre-commit-mirror - repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.8.0 rev: 24.10.0
hooks: hooks:
- id: black - id: black
name: Run Black on Tools/build/check_warnings.py name: Run Black on Tools/build/check_warnings.py
@ -37,7 +37,7 @@ repos:
language_version: python3.12 language_version: python3.12
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0 rev: v5.0.0
hooks: hooks:
- id: check-case-conflict - id: check-case-conflict
- id: check-merge-conflict - id: check-merge-conflict
@ -50,6 +50,21 @@ repos:
- id: trailing-whitespace - id: trailing-whitespace
types_or: [c, inc, python, rst] types_or: [c, inc, python, rst]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
hooks:
- id: check-dependabot
- id: check-github-workflows
- repo: https://github.com/rhysd/actionlint
rev: v1.7.3
hooks:
- id: actionlint
args: [
-ignore=1st argument of function call is not assignable,
-ignore=SC2(015|038|086|091|097|098|129|155),
]
- repo: https://github.com/sphinx-contrib/sphinx-lint - repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v1.0.0 rev: v1.0.0
hooks: hooks: