diff --git a/.appveyor.yml b/.appveyor.yml index 0ad936fb59..aaa44d42bc 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -5,10 +5,9 @@ # This is slow, try to keep the number of builds as low as makes sense. image: - # linux builds done in Travis CI for now + # Test images unsupported by GitHub Actions. - Visual Studio 2017 - Visual Studio 2019 - - Visual Studio 2022 cache: - downloads -> appveyor.yml @@ -19,8 +18,8 @@ cache: install: # direct choco install supposed to work, but not? still doing in install.bat #- cinst: dmd ldc swig vswhere ixsltproc winflexbison3 - - cmd: .\.appveyor\install.bat - - cmd: if %COVERAGE% equ 1 .\.appveyor\install-cov.bat + - ps: .\.appveyor\install.ps1 + - ps: if ($env:COVERAGE -eq 1) { .\.appveyor\install-cov.ps1 } # Build matrix will be number of images multiplied by #entries in matrix:, # less any excludes. @@ -34,38 +33,9 @@ environment: COVERAGE: 0 SCONS_CACHE_MSVC_CONFIG: "true" matrix: - # Test oldest and newest supported Pythons, and a subset in between. - # Skipping 3.8, 3.10, 3.12 at this time - - WINPYTHON: "Python313" - - WINPYTHON: "Python311" - - WINPYTHON: "Python39" - - WINPYTHON: "Python37" - -# remove sets of build jobs based on criteria below -# to fine tune the number and platforms tested -matrix: - exclude: - # test python 3.7 on Visual Studio 2017 image - - image: Visual Studio 2017 - WINPYTHON: "Python313" - - image: Visual Studio 2017 - WINPYTHON: "Python311" - - image: Visual Studio 2017 - WINPYTHON: "Python39" - - # test python 3.9 on Visual Studio 2019 image - - image: Visual Studio 2019 - WINPYTHON: "Python313" - - image: Visual Studio 2019 - WINPYTHON: "Python311" - - image: Visual Studio 2019 - WINPYTHON: "Python37" - - # test python 3.11, 3.13 on Visual Studio 2022 image - - image: Visual Studio 2022 - WINPYTHON: "Python39" - - image: Visual Studio 2022 - WINPYTHON: "Python37" + # Test oldest and newest supported Pythons. + - WINPYTHON: "Python310" + - WINPYTHON: "Python312" # Remove some binaries we don't want to be found # Note this is no longer needed, git-windows bin/ is quite minimal now. diff --git a/.appveyor/install-cov.bat b/.appveyor/install-cov.bat deleted file mode 100644 index 7dbc9457ed..0000000000 --- a/.appveyor/install-cov.bat +++ /dev/null @@ -1,2 +0,0 @@ -for /F "tokens=*" %%g in ('C:\\%WINPYTHON%\\python.exe -c "import sys; print(sys.path[-1])"') do (set PYSITEDIR=%%g) -C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off coverage codecov diff --git a/.appveyor/install-cov.ps1 b/.appveyor/install-cov.ps1 new file mode 100644 index 0000000000..5a7c3fd242 --- /dev/null +++ b/.appveyor/install-cov.ps1 @@ -0,0 +1,3 @@ +$pythonExe = "C:\$($env:WINPYTHON)\python.exe" +$env:PYSITEDIR = & $pythonExe -c "import sys; print(sys.path[-1])" +& $pythonExe -m pip install -U --progress-bar off coverage codecov diff --git a/.appveyor/install.bat b/.appveyor/install.bat deleted file mode 100644 index 95f51155f4..0000000000 --- a/.appveyor/install.bat +++ /dev/null @@ -1,13 +0,0 @@ -C:\\%WINPYTHON%\\python.exe --version -for /F "tokens=*" %%g in ('C:\\%WINPYTHON%\\python.exe -c "import sys; print(sys.path[-1])"') do (set PYSITEDIR=%%g) -REM use mingw 32 bit until #3291 is resolved -REM add python and python user-base to path for pip installs -set PATH=C:\\%WINPYTHON%;C:\\%WINPYTHON%\\Scripts;C:\\ProgramData\\chocolatey\\bin;C:\\MinGW\\bin;C:\\MinGW\\msys\\1.0\\bin;C:\\cygwin\\bin;C:\\msys64\\usr\\bin;C:\\msys64\\mingw64\\bin;%PATH% -C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off pip setuptools wheel - -REM requirements-dev.txt will skip installing lxml for windows and py 3.11+, where there's -REM no current binary wheel -C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off -r requirements-dev.txt - -choco install --allow-empty-checksums dmd ldc swig vswhere xsltproc winflexbison3 -set diff --git a/.appveyor/install.ps1 b/.appveyor/install.ps1 new file mode 100644 index 0000000000..a1a20b2f5f --- /dev/null +++ b/.appveyor/install.ps1 @@ -0,0 +1,48 @@ +$pythonExe = "C:\$($env:WINPYTHON)\python.exe" + +# If the initial call to python --version fails, call "choco install %WINPYTHON%" +$pyVersionSucceeded = $false +try { + if (Test-Path $pythonExe) { + & $pythonExe --version + if ($LASTEXITCODE -eq 0) { + $pyVersionSucceeded = $true + } + } +} catch { + $pyVersionSucceeded = $false +} + +if (-not $pyVersionSucceeded) { + Write-Host "Python version check failed or Python not found at $pythonExe. Installing $env:WINPYTHON via Chocolatey..." + choco install --allow-empty-checksums $env:WINPYTHON +} + +# Set PYSITEDIR +$env:PYSITEDIR = & $pythonExe -c "import sys; print(sys.path[-1])" + +# Use mingw 32 bit until #3291 is resolved +# Add python and python user-base to path for pip installs +$extraPaths = @( + "C:\$($env:WINPYTHON)", + "C:\$($env:WINPYTHON)\Scripts", + "C:\ProgramData\chocolatey\bin", + "C:\MinGW\bin", + "C:\MinGW\msys\1.0\bin", + "C:\cygwin\bin", + "C:\msys64\usr\bin", + "C:\msys64\mingw64\bin" +) +$env:PATH = ($extraPaths + @($env:PATH)) -join ';' + +# pip installs +& $pythonExe -m pip install -U --progress-bar off pip setuptools wheel + +# requirements-dev.txt will skip installing lxml for windows and py 3.11+, where there's +# no current binary wheel +& $pythonExe -m pip install -U --progress-bar off -r requirements-dev.txt + +choco install --allow-empty-checksums dmd ldc swig vswhere xsltproc winflexbison3 + +# Show environment variables +Get-ChildItem Env: | Sort-Object Name diff --git a/.github/workflows/experimental_tests.yml b/.github/workflows/experimental_tests.yml deleted file mode 100644 index ffd2df12f8..0000000000 --- a/.github/workflows/experimental_tests.yml +++ /dev/null @@ -1,88 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Test Experimental Features - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ master ] - pull_request: - branches: [ master ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -env: - # For use by the Windows runner (ignored by the others): - SCONS_CACHE_MSVC_CONFIG: 1 - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "experimental" - experimental: - - strategy: - fail-fast: false - matrix: - # In the 2nd half of 2022 the setup-mingw was often failing on - # windows-latest, when 2022 became the latest. Now 2025 is out, - # and 2019 is being retired, we need some kind of a solution. - cfg: [ - {os: 'ubuntu-latest', args: ''}, - {os: 'windows-latest', args: ''}, - {os: 'macos-latest', args: '--exclude-list=testing/ci/macos_ci_skip.txt'}, - ] - - # The type of runner that the job will run on - runs-on: ${{ matrix.cfg.os }} - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 - - # experiment: maybe don't need this? - # update: looks like we do: with this commented out, the build hung - # - name: Set up MinGW - # uses: egor-tensin/setup-mingw@v2.2.0 - # if: matrix.os == 'windows-2019' - # with: - # platform: x64 - # static: 0 - - - name: Set up MSYS2 ${{ matrix.cfg.os }} - uses: msys2/setup-msys2@v2 - if: startsWith(matrix.cfg.os, 'windows') - with: - msystem: UCRT64 - update: false - install: git mingw-w64-ucrt-x86_64-gcc - - - name: Set up Python 3.11 ${{ matrix.cfg.os }} - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Install dependencies including ninja ${{ matrix.cfg.os }} - run: | - python -m pip install --progress-bar off --upgrade pip - python -m pip install --progress-bar off ninja psutil - # sudo apt-get update - - - name: Populate MSVC cache ${{ matrix.cfg.os }} - if: startsWith(matrix.cfg.os, 'windows') - run: | - python testing/ci/windows_msvc_cache.py - - - name: Test experimental packages ${{ matrix.cfg.os }} - run: | - python runtest.py --time ${{ matrix.cfg.args }} test/import.py test/ninja - - - name: Archive Failed tests ${{ matrix.cfg.os }} - uses: actions/upload-artifact@v4 - if: failure() - with: - name: ${{ matrix.cfg.os }}-failed-tests - path: | - failed_tests.log diff --git a/.github/workflows/framework_tests.yml b/.github/workflows/framework_tests.yml deleted file mode 100644 index 48a5fda88a..0000000000 --- a/.github/workflows/framework_tests.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Test Framework Tests - -on: - # PR events only on master - push: - branches: - - 'master' - paths: - - 'testing/framework/*' - - pull_request: - branches: - - 'master' - paths: - - 'testing/framework/*' - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - fwtest: - strategy: - fail-fast: false - matrix: - os: ['ubuntu-latest', 'windows-latest'] - - # The type of runner that the job will run on - runs-on: ${{ matrix.os }} - - steps: - # Checkouut repository under $GITHUB_WORKSPACE - - uses: actions/checkout@v4 - - - name: Set up Python 3.11 ${{ matrix.os }} - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Test test framework ${{ matrix.os }} - run: | - python runtest.py testing/framework - diff --git a/.github/workflows/runtest-win-msvc.yml b/.github/workflows/runtest-win-msvc.yml deleted file mode 100644 index f22ff90370..0000000000 --- a/.github/workflows/runtest-win-msvc.yml +++ /dev/null @@ -1,62 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Test MSVC Optional Environment - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ master ] - pull_request: - branches: [ master ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -env: - SCONS_CACHE_MSVC_CONFIG: 1 - SCONS_CACHE_MSVC_FORCE_DEFAULTS: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - PSDisableModuleAnalysisCacheCleanup: 1 - VCPKG_DISABLE_METRICS: 1 - VSCMD_SKIP_SENDTELEMETRY: 1 - -jobs: - runtest-msvc: - strategy: - fail-fast: false - matrix: - os: ['windows-latest'] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python 3.12 ${{ matrix.os }} - uses: actions/setup-python@v5 - with: - python-version: '3.12' - cache: 'pip' - - - name: Install Python dependencies ${{ matrix.os }} - run: | - python -m pip install --progress-bar off --upgrade pip - python -m pip install --progress-bar off -r requirements-dev.txt - - - name: runtest ${{ matrix.os }} - run: | - python runtest.py --file=testing/ci/msvc_ci_run.txt --time - - - name: Display MSVC cache ${{ matrix.os }} - if: always() - run: | - python testing/ci/windows_msvc_cache.py --skip-populate - - - name: Archive Failed tests ${{ matrix.os }} - uses: actions/upload-artifact@v4 - if: failure() - with: - name: ${{ matrix.os }}-failed-tests - path: | - failed_tests.log diff --git a/.github/workflows/runtest-win.yml b/.github/workflows/runtest-win.yml deleted file mode 100644 index 5a185aa85a..0000000000 --- a/.github/workflows/runtest-win.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Full Test Suite on Windows - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ master ] - pull_request: - branches: [ master ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -env: - SCONS_CACHE_MSVC_CONFIG: 1 - -jobs: - runtest-win32: - strategy: - fail-fast: false - matrix: - os: ['windows-latest'] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python 3.12 ${{ matrix.os }} - uses: actions/setup-python@v5 - with: - python-version: '3.12' - cache: 'pip' - - - name: Install Python dependencies ${{ matrix.os }} - run: | - python -m pip install --progress-bar off --upgrade pip - python -m pip install --progress-bar off -r requirements-dev.txt - - - name: Install Chocolatey packages ${{ matrix.os }} - run: | - choco install --yes --no-progress dmd winflexbison3 - - - name: Populate MSVC cache ${{ matrix.os }} - run: | - python testing/ci/windows_msvc_cache.py - - - name: runtest ${{ matrix.os }} - run: | - python runtest.py --all --exclude-list=testing/ci/windows_ci_skip.txt --time --jobs=4 - - - name: Archive Failed tests ${{ matrix.os }} - uses: actions/upload-artifact@v4 - if: failure() - with: - name: ${{ matrix.os }}-failed-tests - path: | - failed_tests.log diff --git a/.github/workflows/runtest.yml b/.github/workflows/runtest.yml index 1b36854303..a6ada04a4c 100644 --- a/.github/workflows/runtest.yml +++ b/.github/workflows/runtest.yml @@ -1,61 +1,92 @@ -# This is a basic workflow to help you get started with Actions +name: Full Test Suite +description: Runs the full test suite across various OS/Python configurations. +on: [push, pull_request, workflow_dispatch] -name: Full Test Suite on Linux +concurrency: + group: ${{ github.workflow }}|${{ github.ref_name }} + cancel-in-progress: true -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ master ] - pull_request: - branches: [ master ] +defaults: + run: + shell: bash - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "runtest" runtest: strategy: fail-fast: false matrix: - cfg: [ - {os: 'ubuntu-22.04', py: '3.7'}, - {os: 'ubuntu-24.04', py: '3.13'}, - ] - - runs-on: ${{ matrix.cfg.os }} + os: [macos-15, ubuntu-22.04, ubuntu-24.04, windows-2022, windows-2025] + python: ["3.9", "3.14"] + runs-on: ${{ matrix.os }} + timeout-minutes: 30 steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup Python + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python }} + cache: pip + pip-install: --group dev - - name: Install Ubuntu packages ${{ matrix.cfg.os }} + - name: Setup Ubuntu dependencies + if: startsWith(matrix.os, 'ubuntu') run: | sudo apt-get update sudo apt-get install libtirpc-dev - - name: Set up Python ${{ matrix.cfg.py }} ${{ matrix.cfg.os }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.cfg.py }} - cache: 'pip' + - name: Setup Windows dependencies + if: startsWith(matrix.os, 'windows') + run: | + choco install --yes --no-progress dmd winflexbison3 + # Environment variables to disable telemetry and enable MSVC caching. + echo "POWERSHELL_TELEMETRY_OPTOUT=1" >> $GITHUB_ENV + echo "PSDisableModuleAnalysisCacheCleanup=1" >> $GITHUB_ENV + echo "SCONS_CACHE_MSVC_CONFIG=1" >> $GITHUB_ENV + echo "VCPKG_DISABLE_METRICS=1" >> $GITHUB_ENV + echo "VSCMD_SKIP_SENDTELEMETRY=1" >> $GITHUB_ENV + # Populate the MSVC cache. + python testing/ci/windows_msvc_cache.py - - name: Install Python ${{ matrix.cfg.py }} dependencies ${{ matrix.cfg.os }} + - name: Setup excluded tests run: | - python -m pip install --progress-bar off --upgrade pip - python -m pip install --progress-bar off -r requirements-dev.txt - # sudo apt-get update + touch .excludes + if [[ "${{matrix.os}}" == "macos"* ]]; then + echo "test/Docbook/basic/epub/epub_live.py" >> .excludes + echo "test/Docbook/basic/html/html_live.py" >> .excludes + echo "test/Docbook/basic/htmlchunked/htmlchunked_live.py" >> .excludes + echo "test/Docbook/basic/htmlhelp/htmlhelp_live.py" >> .excludes + echo "test/Libs/LIBLITERALPREFIX.py" >> .excludes + echo "test/Rpcgen/live.py" >> .excludes + echo "test/builderrors.py" >> .excludes + echo "test/ninja/ninja_handle_control_c_rebuild.py" >> .excludes + echo "test/ninja/shutdown_scons_daemon.py" >> .excludes + echo "test/scons-time/run/option/verbose.py" >> .excludes + elif [[ "${{matrix.os}}" == "windows"* ]]; then + echo "test/CPPDEFINES/pkg-config.py" >> .excludes + echo "test/packaging/msi/explicit-target.py" >> .excludes + echo "test/packaging/msi/file-placement.py" >> .excludes + echo "test/packaging/msi/package.py" >> .excludes + if [[ "${{matrix.os}}" == "windows-2022" ]]; then + echo "test/scons-time/run/config/python.py" >> .excludes + echo "test/scons-time/run/option/python.py" >> .excludes + echo "test/sconsign/script/no-SConsignFile.py" >> .excludes + echo "test/sconsign/script/SConsignFile.py" >> .excludes + echo "test/sconsign/script/Signatures.py" >> .excludes + fi + fi + cat .excludes - - name: runtest ${{ matrix.cfg.os }} ${{ matrix.cfg.py }} + - name: Run tests + id: run-tests run: | - python runtest.py --all --time --jobs=4 + python runtest.py SCons test testing --time --jobs=0 --exclude-list=.excludes - - name: Archive Failed tests ${{ matrix.cfg.os }} ${{ matrix.cfg.py }} - uses: actions/upload-artifact@v4 - if: failure() + - name: Archive failed tests + uses: actions/upload-artifact@v7 + if: always() && steps.run-tests.outcome == 'failure' with: - name: ${{ matrix.cfg.os }}-${{ matrix.cfg.py }}-failed-tests - path: | - failed_tests.log + name: ${{ matrix.os }}-${{ matrix.python }}-failed-tests + path: failed_tests.log diff --git a/CHANGES.txt b/CHANGES.txt index a6963f268b..eef4f578cf 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -28,6 +28,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Ruff: Handle F401 exclusions more granularly, remove per-file exclusions. - Implement type hints for Environment and environment utilities. - Deprecated Python 3.7 & 3.8 support. + - Modernized GitHub Actions test runner. This consolidates the logic of + existing test environments into a single package. Adjusted AppVeyor to + only run for targets unsupported by GitHub runners. From William Deegan: - Fix SCons Docbook schema to work with lxml > 5 diff --git a/RELEASE.txt b/RELEASE.txt index 571cc35d17..11665fb478 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -115,6 +115,10 @@ DEVELOPMENT - MSVC: Added a host/target batch file configuration table for Visual Studio 2026. Visual Studio 2026 removed support for 32-bit arm targets. +- Modernized GitHub Actions test runner. This consolidates the logic of + existing test environments into a single package. Adjusted AppVeyor to + only run for targets unsupported by GitHub runners. + Thanks to the following contributors listed below for their contributions to this release. ========================================================================================== diff --git a/test/option/stack-size.py b/test/option/stack-size.py index bb6e78555f..cab6bb83e1 100644 --- a/test/option/stack-size.py +++ b/test/option/stack-size.py @@ -85,6 +85,16 @@ File .* """ +expect_invalid_size=""" +scons: warning: Setting stack size failed: + size (not valid: 16384 bytes|must be at least 53248 bytes) +File .* + +scons: warning: Setting stack size failed: + size (not valid: 16384 bytes|must be at least 53248 bytes) +File .* +""" + # # Test without any options @@ -170,30 +180,14 @@ arguments = '-j2 --stack-size=16 .', match=TestSCons.match_re, stdout=re_expected_stdout, - stderr=""" -scons: warning: Setting stack size failed: - size not valid: 16384 bytes -File .* - -scons: warning: Setting stack size failed: - size not valid: 16384 bytes -File .* -""") + stderr=expect_invalid_size) test.must_exist(['work1', 'f1.out']) test.must_exist(['work1', 'f2.out']) test.run(chdir='work1', arguments = '-j2 --stack-size=16 -c .', match=TestSCons.match_re, - stderr=""" -scons: warning: Setting stack size failed: - size not valid: 16384 bytes -File .* - -scons: warning: Setting stack size failed: - size not valid: 16384 bytes -File .* -""") + stderr=expect_invalid_size) test.must_not_exist(['work1', 'f1.out']) test.must_not_exist(['work1', 'f2.out']) diff --git a/testing/ci/macos_ci_skip.txt b/testing/ci/macos_ci_skip.txt deleted file mode 100644 index c9a94f1acb..0000000000 --- a/testing/ci/macos_ci_skip.txt +++ /dev/null @@ -1,3 +0,0 @@ -# temporarily skip this in GitHub MacOS Experimental runner -test/ninja/ninja_handle_control_c_rebuild.py -test/ninja/shutdown_scons_daemon.py diff --git a/testing/ci/windows_ci_skip.txt b/testing/ci/windows_ci_skip.txt deleted file mode 100644 index 6f96386f5a..0000000000 --- a/testing/ci/windows_ci_skip.txt +++ /dev/null @@ -1,10 +0,0 @@ -# temporarily skip this in GitHub Windows runner -test/CPPDEFINES/pkg-config.py -test/packaging/msi/explicit-target.py -test/packaging/msi/file-placement.py -test/packaging/msi/package.py -test/scons-time/run/config/python.py -test/scons-time/run/option/python.py -test/sconsign/script/no-SConsignFile.py -test/sconsign/script/SConsignFile.py -test/sconsign/script/Signatures.py