Skip to content

Commit 1f12224

Browse files
committed
clean up CI files
1 parent aa5378e commit 1f12224

File tree

11 files changed

+102
-79
lines changed

11 files changed

+102
-79
lines changed

.appveyor.yml

Lines changed: 6 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
image:
44
# linux builds done in Travis CI for now
5-
# - Ubuntu
65
- Visual Studio 2015
76
- Visual Studio 2017
87
- Visual Studio 2019
@@ -15,17 +14,7 @@ cache:
1514

1615
install:
1716
# add python and python user-base to path for pip installs
18-
- cmd: "C:\\%WINPYTHON%\\python.exe --version"
19-
- cmd: for /F "tokens=*" %%g in ('C:\\%WINPYTHON%\\python.exe -c "import sys; print(sys.path[-1])"') do (set PYSITEDIR=%%g)
20-
# use mingw 32 bit until #3291 is resolved
21-
- cmd: "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%"
22-
- cmd: "C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off pip setuptools wheel "
23-
- cmd: "C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off pypiwin32 coverage codecov"
24-
- cmd: set STATIC_DEPS=true & C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off lxml
25-
# install 3rd party tools to test with
26-
- cmd: choco install --allow-empty-checksums dmd ldc swig vswhere xsltproc winflexbison
27-
- cmd: set SCONS_CACHE_MSVC_CONFIG=true
28-
- cmd: set
17+
- cmd: .\.appveyor\install.bat
2918

3019
# build matrix will be number of images multiplied by each '-' below,
3120
# less any exclusions.
@@ -72,56 +61,27 @@ matrix:
7261

7362
# remove some binaries we don't want to be found
7463
before_build:
75-
- ps: |
76-
if ($isWindows) {
77-
dir "C:\Program Files\Git\usr\bin\x*.exe"
78-
if (Test-Path "C:\Program Files\Git\usr\bin\xsltproc.EXE" ) {
79-
Remove-Item "C:\Program Files\Git\usr\bin\xsltproc.EXE" -ErrorAction Ignore
80-
}
81-
dir "C:\Program Files\Git\usr\bin\x*.exe"
82-
}
64+
- ps: .\.appveyor\ignore_git_bins.ps1
8365

8466
build: off
8567

8668
build_script:
8769

8870
# exclude VS 10.0 because it hangs the testing until this is resolved:
8971
# https://help.appveyor.com/discussions/problems/19283-visual-studio-2010-trial-license-has-expired
90-
- ps: |
91-
New-Item -Name exclude_list.txt -ItemType File
92-
$workaround_image = "Visual Studio 2015"
93-
if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq $workaround_image) {
94-
Add-Content -Path 'exclude_list.txt' -Value 'test\MSVS\vs-10.0-exec.py'
95-
}
72+
- ps: .\.appveyor\disable_msvc_10.ps1
9673

9774
# setup coverage by creating the coverage config file, and adding coverage
9875
# to the sitecustomize so that all python processes start with coverage
99-
- ps: |
100-
if ($env:COVERAGE -eq 1) {
101-
$env:COVERAGE_PROCESS_START = "$($env:APPVEYOR_BUILD_FOLDER)/.coveragerc";
102-
$env:COVERAGE_FILE = "$($env:APPVEYOR_BUILD_FOLDER)/.coverage";
103-
New-Item -ItemType Directory -Force -Path "$($env:PYSITEDIR)";
104-
$sitecustomizeText = "import os`r`nos.environ['COVERAGE_PROCESS_START'] = '$($env:COVERAGE_PROCESS_START)'`r`nos.environ['COVERAGE_FILE'] = '$($env:COVERAGE_FILE)'`r`nimport coverage`r`ncoverage.process_startup()";
105-
$sitecustomizeText|Set-Content "$($env:PYSITEDIR)/sitecustomize.py";
106-
Get-Content -Path "$($env:PYSITEDIR)/sitecustomize.py";
107-
$coveragercFile = "[run]`r`nsource = $($env:APPVEYOR_BUILD_FOLDER)/SCons`r`nparallel = True`r`ndisable_warnings = trace-changed`r`nomit =`r`n`t*Tests.py`r`n`t*\src\*`r`n`t*\test\*`r`n`t*\testing\*`r`n`t*\template\*`r`n`t*\scripts\*`r`n`t*\scons-time.py`r`n`t*\bootstrap.py`r`n`t*\runtest.py`r`n`t*\setup.py`r`n`r`n[path]`r`nsource = $($env:APPVEYOR_BUILD_FOLDER)`r`n[report]`r`nomit =`r`n`t*Tests.py`r`n`t*\src\*`r`n`t*\test\*`r`n`t*\testing\*`r`n`t*\template\*`r`n`t*\scripts\*`r`n`t*\scons-time.py`r`n`t*\bootstrap.py`r`n`t*\runtest.py`r`n`t*\setup.py`r`n`r`n"
108-
$coveragercFile|Set-Content "$($env:COVERAGE_PROCESS_START)";
109-
Get-Content -Path "$($env:COVERAGE_PROCESS_START)";
110-
}
111-
112-
76+
- ps: .\.appveyor\coverage_setup.ps1
77+
11378
# NOTE: running powershell from cmd is intended because
11479
# it formats the output correctly
11580
- cmd: powershell -Command "& { if($env:COVERAGE -eq 1) { coverage run -p --rcfile=$($env:COVERAGE_PROCESS_START) runtest.py -j 2 -t --exclude-list exclude_list.txt -a } else { C:\\%WINPYTHON%\\python.exe runtest.py -j 2 -t --exclude-list exclude_list.txt -a }; if($LastExitCode -eq 2 -Or $LastExitCode -eq 0) { $host.SetShouldExit(0 )} else {$host.SetShouldExit(1)}}"
11681

11782
# run coverage even if there was a test failure
11883
on_finish:
119-
- ps: |
120-
if ($env:COVERAGE -eq 1) {
121-
& coverage combine
122-
& coverage report
123-
& coverage xml -i -o coverage_xml.xml
124-
}
84+
- ps: .\.appveyor\coverage_report.ps1
12585
# running codecov in powershell causes an error so running in platform
12686
# shells
12787
- cmd: if %COVERAGE% equ 1 codecov -X gcov --file coverage_xml.xml

.appveyor/coverage_report.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if ($env:COVERAGE -eq 1) {
2+
& coverage combine;
3+
& coverage report;
4+
& coverage xml -i -o coverage_xml.xml;
5+
}

.appveyor/coverage_setup.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
if ($env:COVERAGE -eq 1) {
2+
$env:COVERAGE_PROCESS_START = "$($env:APPVEYOR_BUILD_FOLDER)\.coveragerc";
3+
$env:COVERAGE_FILE = "$($env:APPVEYOR_BUILD_FOLDER)\.coverage";
4+
New-Item -ItemType Directory -Force -Path "$($env:PYSITEDIR)";
5+
6+
(Get-Content -path .coverage_templates\.coveragerc.template -Raw) -replace '\$PWD',"$((Get-Location) -replace '\\', '/')" | Set-Content -Path "$($env:COVERAGE_PROCESS_START)";
7+
(Get-Content -path .coverage_templates\sitecustomize.py.template -Raw) -replace '\$PWD',"$((Get-Location) -replace '\\', '/')" | Set-Content -Path "$($env:PYSITEDIR)\sitecustomize.py";
8+
9+
Write-Host "$($env:PYSITEDIR)\sitecustomize.py";
10+
Get-Content -Path "$($env:PYSITEDIR)\sitecustomize.py";
11+
Write-Host "$($env:COVERAGE_PROCESS_START)";
12+
Get-Content -Path "$($env:COVERAGE_PROCESS_START)";
13+
}

.appveyor/disable_msvc_10.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
New-Item -Name exclude_list.txt -ItemType File;
2+
$workaround_image = "Visual Studio 2015";
3+
if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq $workaround_image) {
4+
Add-Content -Path 'exclude_list.txt' -Value 'test\MSVS\vs-10.0-exec.py';
5+
}

.appveyor/ignore_git_bins.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dir "C:\Program Files\Git\usr\bin\x*.exe";
2+
if (Test-Path "C:\Program Files\Git\usr\bin\xsltproc.EXE" ) {
3+
Remove-Item "C:\Program Files\Git\usr\bin\xsltproc.EXE" -ErrorAction Ignore;
4+
}
5+
dir "C:\Program Files\Git\usr\bin\x*.exe";

.appveyor/install.bat

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
C:\\%WINPYTHON%\\python.exe --version
2+
for /F "tokens=*" %%g in ('C:\\%WINPYTHON%\\python.exe -c "import sys; print(sys.path[-1])"') do (set PYSITEDIR=%%g)
3+
REM use mingw 32 bit until #3291 is resolved
4+
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%
5+
C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off pip setuptools wheel
6+
C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off pypiwin32 coverage codecov
7+
set STATIC_DEPS=true & C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off lxml
8+
REM install 3rd party tools to test with
9+
choco install --allow-empty-checksums dmd ldc swig vswhere xsltproc winflexbison
10+
set SCONS_CACHE_MSVC_CONFIG=true
11+
set
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[run]
2+
source = $PWD
3+
parallel = True
4+
omit =
5+
*Tests.py
6+
*/src/*
7+
*/test/*
8+
*/testing/*
9+
*/template/*
10+
*/scripts/*
11+
*/scons-time.py
12+
*/bootstrap.py
13+
*/runtest.py
14+
*/setup.py
15+
16+
[path]
17+
source = $PWD
18+
19+
[report]
20+
omit =
21+
*Tests.py
22+
*/src/*
23+
*/test/*
24+
*/testing/*
25+
*/template/*
26+
*/scripts/*
27+
*/scons-time.py
28+
*/bootstrap.py
29+
*/runtest.py
30+
*/setup.py
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import os
2+
os.environ['COVERAGE_PROCESS_START'] = r'$PWD/.coveragerc'
3+
os.environ['COVERAGE_FILE'] = r'$PWD/.coverage'
4+
import coverage
5+
coverage.process_startup()

.travis.yml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -67,31 +67,7 @@ jobs:
6767
python: 3.7
6868
name: coverage
6969
before_script:
70-
- python -m pip install -U coverage codecov
71-
- python -m site
72-
# setup sitecustomize so we can make all subprocess start coverage
73-
- export PYSITEDIR=$(python -c "import sys; print(sys.path[-1])")
74-
- export COVERAGE_PROCESS_START="$PWD/.coveragerc"
75-
- export COVERAGE_FILE="$PWD/.coverage"
76-
- mkdir -p "$PYSITEDIR"
77-
- echo "$PYSITEDIR"
78-
- touch "${PYSITEDIR}/sitecustomize.py"
79-
- echo "import os" | tee --append "${PYSITEDIR}/sitecustomize.py"
80-
- echo "os.environ['COVERAGE_PROCESS_START'] = '$PWD/.coveragerc'" | tee --append "${PYSITEDIR}/sitecustomize.py"
81-
- echo "os.environ['COVERAGE_FILE'] = '$PWD/.coverage'" | tee --append "${PYSITEDIR}/sitecustomize.py"
82-
- echo "import coverage" | tee --append "${PYSITEDIR}/sitecustomize.py"
83-
- echo "coverage.process_startup()" | tee --append "${PYSITEDIR}/sitecustomize.py"
84-
- cat "${PYSITEDIR}/sitecustomize.py"
85-
# write the coverage config file
86-
- echo "[run]" >> "$PWD/.coveragerc"
87-
- echo "source = $PWD" >> "$PWD/.coveragerc"
88-
- echo "parallel = True" >> "$PWD/.coveragerc"
89-
- printf "omit =\n\t*Tests.py\n\t*/src/*\n\t*/test/*\n\t*/testing/*\n\t*/template/*\n\t*/scripts/*\n\t*/scons-time.py\n\t*/bootstrap.py\n\t*/runtest.py\n\t*/setup.py\n\n" >> "$PWD/.coveragerc"
90-
- echo "[path]" >> "$PWD/.coveragerc"
91-
- echo "source = $PWD" >> "$PWD/.coveragerc"
92-
- echo "[report]" >> "$PWD/.coveragerc"
93-
- printf "omit =\n\t*Tests.py\n\t*/src/*\n\t*/test/*\n\t*/testing/*\n\t*/template/*\n\t*/scripts/*\n\t*/scons-time.py\n\t*/bootstrap.py\n\t*/runtest.py\n\t*/setup.py\n\n" >> "$PWD/.coveragerc"
94-
- cat "$PWD/.coveragerc"
70+
- ./.travis/coverage_setup.sh
9571

9672
script:
9773
- coverage run -p --rcfile="$PWD/.coveragerc" runtest.py -a -j 2 || if [[ $? == 2 ]]; then true; else false; fi

.travis/.coveragerc

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

0 commit comments

Comments
 (0)