@@ -52,7 +52,7 @@ matrix:
5252
5353cache :
5454 # Cache downloaded pip packages.
55- - " C: \\ Users \\ appveyor \\ AppData \\ Local \\ pip"
55+ - " %LOCALAPPDATA% \\ pip"
5656
5757init :
5858 - " ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
@@ -82,7 +82,9 @@ install:
8282 ) ELSE (
8383 %CMD_IN_ENV% pip install -U --disable-pip-version-check --timeout 5 --retries 2 -r tests/requirements-win.txt )"
8484
85- - " %CMD_IN_ENV% python setup.py bdist_wheel"
85+ - " %CMD_IN_ENV% python tests/scripts/appveyor/fetch_wrapper.py"
86+
87+ - " %CMD_IN_ENV% build-wrapper-win-x86-64 --out-dir sonar python setup.py bdist_wheel"
8688 - " %CMD_IN_ENV% python tests/scripts/install_wheels.py dist"
8789
8890build : none
@@ -94,9 +96,34 @@ test_script:
9496
9597artifacts :
9698 - path : ' **\*.whl'
99+
100+ on_success :
101+ # Remove old or huge cache files to hopefully not exceed the 1GB cache limit.
102+ #
103+ # If the cache limit is reached, the cache will not be updated (of not even
104+ # created in the first run). So this is a trade of between keeping the cache
105+ # current and having a cache at all.
106+ # NB: This is done only `on_success` since the cache in uploaded only on
107+ # success anyway.
108+ - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete
109+ - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete
110+ - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete
111+ # Show size of cache
112+ - C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache"
97113
98114on_finish :
99115 # - "python .\\tests\\scripts\\list_sitepackages.py"
100- - ps : (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\junit-results.xml))
101-
102- - " sonar-scanner -Dsonar.projectKey=pywin32 -Dsonar.sources=. -Dsonar.host.url=https://sonarqube.com -Dsonar.login=%SONAR_TOKEN% -Dsonar.cfamily.build-wrapper-output.bypass=true"
116+ - ps : |
117+ (new-object net.webclient).UploadFile(
118+ "https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)",
119+ (Resolve-Path .\junit-results.xml)
120+ )
121+ - ps : |
122+ if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
123+ sonar-scanner `
124+ -Dsonar.projectKey=pywin32 `
125+ -Dsonar.sources=. `
126+ -Dsonar.host.url=https://sonarqube.com `
127+ -Dsonar.login=%SONAR_TOKEN% `
128+ -Dsonar.cfamily.build-wrapper-output=sonar
129+ }
0 commit comments