-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
! update ci scripts, prepair for appveyor ci
- Loading branch information
Showing
11 changed files
with
133 additions
and
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,77 @@ | ||
# How to use AppVeyor to build a multi-arch Docker image for Linux and Windows | ||
# https://stefanscherer.github.io/use-appveyor-to-build-multi-arch-docker-image/ | ||
# | ||
# Building ASP.NET Core apps on both Windows and Linux using AppVeyor | ||
# https://andrewlock.net/building-asp-net-core-apps-on-both-windows-and-linux-using-appveyor/ | ||
# | ||
# appveyor.yml Example: | ||
# https://github.com/cdcseacave/openMVS/blob/master/.appveyor.yml | ||
|
||
version: '{build}' | ||
os: Windows Server 2012 | ||
build: off | ||
image: | ||
- Ubuntu2004 | ||
- Visual Studio 2017 | ||
build: false | ||
clone_depth: 50 | ||
branches: | ||
except: | ||
- travis-ci.* | ||
- travis-ci | ||
- gh-pages | ||
|
||
environment: | ||
matrix: | ||
- JAVA_HOME: "C:\\Program Files (x86)\\Java\\jdk1.8.0" | ||
- JAVA_HOME: "C:\\Program Files\\Java\\jdk1.8.0" | ||
- JAVA_HOME: "C:\\Program Files\\Java\\jdk9" | ||
- JAVA_HOME: "C:\\Program Files\\Java\\jdk10" | ||
- JAVA_HOME: "C:\\Program Files\\Java\\jdk11" | ||
|
||
init: | ||
- ps: "ls 'C:/Program Files/Java/jdk*'" | ||
- ps: "ls 'C:/Program Files (x86)/Java/jdk*'" | ||
|
||
install: | ||
- cmd: SET PATH=%JAVA_HOME%\bin;%PATH% | ||
- cmd: SET MAVEN_OPTS=-Xmx768m -XX:MaxPermSize=128m | ||
- cmd: SET JAVA_OPTS=-Xmx768m -XX:MaxPermSize=128m | ||
- "ECHO JAVA_HOME=%JAVA_HOME%, HOMEPATH=%HOMEPATH%, PATH=%PATH%" | ||
- cmd: ./mvnw.cmd --version | ||
|
||
test_script: | ||
- ./mvnw.cmd clean install --batch-mode | ||
- ./mvnw.cmd dependency:copy-dependencies -DincludeScope=test -DexcludeArtifactIds=javassist,jsr305 | ||
- echo "Run Agent test" | ||
- ps: | | ||
$ttl_jar=Get-ChildItem target\transmittable-thread-local-*.jar -Exclude *-sources.jar | Select-Object -ExpandProperty FullName | ||
$cp=Get-ChildItem target\dependency\*.jar | Select-Object -ExpandProperty FullName | ||
$cp=$cp + 'target\test-classes' | ||
$cp=$cp -join ';' | ||
echo "java -Xmx256m -Xms256m -javaagent:$ttl_jar -cp $cp -ea com.alibaba.ttl.threadpool.agent.AgentCheck" | ||
$output=java -Xmx256m -Xms256m -javaagent:$ttl_jar -cp $cp -ea com.alibaba.ttl.threadpool.agent.AgentCheck 2>&1 | ||
$output.CategoryInfo.TargetName | Out-Default | ||
cache: | ||
- C:\maven\ | ||
- C:\Users\appveyor\.m2\ | ||
APPVEYOR_YML_DISABLE_PS_LINUX: true | ||
MAVEN_OPTS: "-Xmx768m -XX:MaxPermSize=128m -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2" | ||
JAVA_OPTS: "-Xmx768m -XX:MaxPermSize=128m" | ||
|
||
for: | ||
- | ||
#------------------ | ||
# Ubuntu | ||
#------------------ | ||
matrix: | ||
only: | ||
- image: Ubuntu2004 | ||
|
||
test_script: | ||
- sh: ./scripts/integration-test.sh | ||
|
||
after_test: | ||
- sh: ./scripts/codecov.sh | ||
- sh: rm -rf $HOME/.m2/repository/com/alibaba/transmittable-thread-local* | ||
- sh: rm -rf $HOME/.m2/repository/com/alibaba/ttl* | ||
- sh: rm -rf $HOME/.sdkman/archives/* | ||
|
||
cache: | ||
# if cache size is exceed appveyor limit: | ||
# Compressed cache item cannot exceed 1,048,576,000 bytes | ||
# skip below maven cache: | ||
- $HOME/.m2/ | ||
- $HOME/.sdkman/ | ||
- | ||
#------------------ | ||
# Windows | ||
#------------------ | ||
matrix: | ||
only: | ||
- image: Visual Studio 2017 | ||
install: | ||
- ps: "ls 'C:/Program Files/Java/jdk*'" | ||
- ps: "ls 'C:/Program Files (x86)/Java/jdk*'" | ||
- cmd: echo JAVA_HOME=%JAVA_HOME%, HOMEPATH=%HOMEPATH%, PATH=%PATH% | ||
|
||
test_script: | ||
# test under java 8 | ||
- cmd: set JAVA_HOME=C:\Program Files\Java\jdk1.8.0 | ||
- ./mvnw.cmd -V clean install --no-transfer-progress | ||
# test under java 11 | ||
- cmd: set JAVA_HOME=C:\Program Files\Java\jdk11 | ||
- ./mvnw.cmd -V clean install --no-transfer-progress | ||
|
||
after_test: | ||
- ps: Remove-Item -r -fo $home\.m2\repository\com\alibaba\transmittable-thread-local* | ||
- ps: Remove-Item -r -fo $home\.m2\repository\com\alibaba\ttl* | ||
|
||
cache: | ||
# https://www.appveyor.com/docs/build-cache/ | ||
- '%HOMEDRIVE%%HOMEPATH%\.m2\' | ||
|
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env pwsh | ||
|
||
# https://stackoverflow.com/questions/24649019/how-to-use-confirm-in-powershell | ||
$confirmation = Read-Host "Are you Sure You Want To Clear cache of appveyor project oldratlee/transmittable-thread-local" | ||
if ($confirmation -ne 'y') { | ||
Write-Output "do nothing and exit" | ||
exit | ||
} | ||
|
||
# PowerShell: Run command from script's directory - Stack Overflow | ||
# https://stackoverflow.com/questions/4724290 | ||
$script_path = $MyInvocation.MyCommand.Path | ||
$script_dir = Split-Path $script_path | ||
|
||
# Equivalent of bash's `source` command in Powershell? - Super User | ||
# https://superuser.com/questions/71446 | ||
# Script scope and dot sourcing - PowerShell | Microsoft Docs | ||
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_scripts#script-scope-and-dot-sourcing | ||
. "$script_dir\appveyor_token.ps1" | ||
# file appveyor_token.ps1 provide appveyor token. content sample: | ||
# $appveyor_token = xxx | ||
|
||
# https://www.appveyor.com/docs/build-cache/#remove-cache-entry-from-build-config | ||
# https://www.appveyor.com/docs/api/#authentication | ||
|
||
$headers = @{} | ||
$headers['Authorization'] = "Bearer $appveyor_token" | ||
$headers["Content-type"] = "application/json" | ||
Invoke-RestMethod -Uri 'https://ci.appveyor.com/api/projects/oldratlee/transmittable-thread-local/buildcache' -Headers $headers -Method Delete |
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
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