mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-11-11 01:55:38 +08:00
5787f07617
appveyour cmake
276 lines
8.9 KiB
YAML
276 lines
8.9 KiB
YAML
version: 3.0.1.{build}
|
|
image: Visual Studio 2019
|
|
clone_folder: C:\ProxSpace\pm3
|
|
init:
|
|
- ps: >-
|
|
$psversiontable
|
|
|
|
#Get-ChildItem Env:
|
|
|
|
$releasename=""
|
|
|
|
$env:APPVEYOR_REPO_COMMIT_SHORT = $env:APPVEYOR_REPO_COMMIT.Substring(0, 8)
|
|
|
|
if ($env:appveyor_repo_tag -match "true"){
|
|
$releasename=$env:APPVEYOR_REPO_TAG_NAME + "/"
|
|
}
|
|
|
|
$releasename+=$env:APPVEYOR_BUILD_VERSION + " [" + $env:APPVEYOR_REPO_COMMIT_SHORT + "]"
|
|
|
|
|
|
Write-Host "repository: $env:appveyor_repo_name branch:$env:APPVEYOR_REPO_BRANCH release: $releasename" -ForegroundColor Yellow
|
|
|
|
Add-AppveyorMessage -Message "[$env:APPVEYOR_REPO_COMMIT_SHORT]$env:appveyor_repo_name($env:APPVEYOR_REPO_BRANCH)" -Category Information -Details "repository: $env:appveyor_repo_name branch: $env:APPVEYOR_REPO_BRANCH release: $releasename"
|
|
|
|
# iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
|
clone_script:
|
|
- ps: >-
|
|
Write-Host "Removing ProxSpace..." -NoNewLine
|
|
|
|
$CloneTime=[System.Environment]::TickCount
|
|
|
|
cd \
|
|
|
|
Remove-Item -Recurse -Force -Path c:\ProxSpace\*
|
|
|
|
Write-Host "[ OK ]" -ForegroundColor Green
|
|
|
|
|
|
Write-Host "Git clone ProxSpace..." -NoNewLine
|
|
|
|
git clone -q https://github.com/Gator96100/ProxSpace c:\ProxSpace
|
|
|
|
Write-Host "[ OK ]" -ForegroundColor Green
|
|
|
|
|
|
if(!(Test-Path -Path C:\ProxSpace\pm3)){
|
|
|
|
New-Item -ItemType Directory -Force -Path C:\ProxSpace\pm3
|
|
|
|
}
|
|
|
|
Write-Host "Removing pm3 dir..." -NoNewLine
|
|
|
|
Remove-Item -Recurse -Force -Path c:\ProxSpace\pm3\*
|
|
|
|
Write-Host "[ OK ]" -ForegroundColor Green
|
|
|
|
|
|
Write-Host "Cloning repository <$env:appveyor_repo_name> to $env:appveyor_build_folder ..." -NoNewLine
|
|
|
|
if(-not $env:appveyor_pull_request_number) {
|
|
git clone -q --branch=$env:appveyor_repo_branch https://github.com/$env:appveyor_repo_name.git $env:appveyor_build_folder
|
|
cd $env:appveyor_build_folder
|
|
git checkout -qf $env:appveyor_repo_commit
|
|
} else {
|
|
git clone -q https://github.com/$env:appveyor_repo_name.git $env:appveyor_build_folder
|
|
cd $env:appveyor_build_folder
|
|
git fetch -q origin +refs/pull/$env:appveyor_pull_request_number/merge:
|
|
git checkout -qf FETCH_HEAD
|
|
}
|
|
|
|
Write-Host "[ OK ]" -ForegroundColor Green
|
|
|
|
|
|
Write-Host "Fill msys2\etc\fstab file..." -NoNewLine
|
|
|
|
New-Item c:\ProxSpace\msys2\etc\fstab -type file -force -value "# For a description of the file format, see the Users Guide`n# http://cygwin.com/cygwin-ug-net/using.html#mount-table`nnone / cygdrive binary,posix=0,noacl,user 0 0 `nC:\ProxSpace\pm3 /pm3 ntfs noacl 0 0 `nC:\ProxSpace\gcc-arm-none-eabi /gcc-arm-none-eabi ntfs noacl 0 0 `n"
|
|
|
|
Write-Host "[ OK ]" -ForegroundColor Green
|
|
|
|
|
|
Write-Host "Update msys2 packages..."
|
|
|
|
$env:Path = "C:\ProxSpace\msys2\usr\bin;C:\ProxSpace\msys2\mingw32\bin;C:\ProxSpace\gcc-arm-none-eabi\bin;$env:Path"
|
|
|
|
Function ExecUpdate($Name, $Cmd, $ErrorLine) {
|
|
|
|
Write-Host "Exec [$Name]... " -NoNewLine
|
|
#--- begin Job
|
|
|
|
$Job = Start-Job -Name "$Name" -ScriptBlock {
|
|
$env:Path = "C:\ProxSpace\msys\bin;$env:Path"
|
|
Set-Location $using:PWD
|
|
|
|
$sb=[scriptblock]::Create("$using:Cmd")
|
|
#execute scriptblock
|
|
$Cond=&$sb
|
|
|
|
return $Cond
|
|
}
|
|
|
|
#--- end Job
|
|
|
|
$JobTime=[System.Environment]::TickCount
|
|
while($true) {
|
|
Try {
|
|
$Res = Receive-Job -Job $Job -Keep 2>&1 6>&1
|
|
}
|
|
Catch {
|
|
$Res = ""
|
|
Write-host "error in Receive-Job"
|
|
}
|
|
|
|
if ($Res -is "String" -and $Res -like "*$ErrorLine*"){
|
|
Write-host "Exit by stop phrase" -ForegroundColor Green
|
|
break
|
|
}
|
|
|
|
if ($Res -is [Object]){
|
|
[bool]$needexit = $false
|
|
ForEach($line in $Res){
|
|
if ($line -like "*$ErrorLine*"){
|
|
Write-host "Exit by stop phrase [obj]" -ForegroundColor Green
|
|
$needexit = $true
|
|
break
|
|
}
|
|
}
|
|
if ($needexit) {
|
|
break
|
|
}
|
|
}
|
|
|
|
if(Wait-Job $Job -Timeout 5){
|
|
Write-host "Exit by end job" -ForegroundColor Green
|
|
break
|
|
}
|
|
|
|
if ([System.Environment]::TickCount-$JobTime -gt 1000000) {
|
|
Write-host "Exit by timeout" -ForegroundColor Yellow
|
|
break
|
|
}
|
|
}
|
|
|
|
Remove-Job -Force $Job
|
|
}
|
|
|
|
cd C:\ProxSpace\
|
|
|
|
C:\ProxSpace\msys2\ps\setup.cmd
|
|
|
|
ExecUpdate "update1" "C:\ProxSpace\msys2\msys2_shell.cmd -mingw32 -defterm -no-start /dev/null" "terminate?MSYS2"
|
|
|
|
ExecUpdate "update2" "C:\ProxSpace\msys2\msys2_shell.cmd -mingw32 -defterm -no-start /dev/null" "terminate?MSYS2"
|
|
|
|
Add-AppveyorMessage -Message "ProxSpace download and update took $(([System.Environment]::TickCount-$CloneTime) / 1000) sec" -Category Information
|
|
|
|
Write-Host "Update " -NoNewLine
|
|
|
|
Write-Host "[ OK ]" -ForegroundColor Green
|
|
install:
|
|
build_script:
|
|
- ps: >-
|
|
$env:Path="C:\ProxSpace\msys2\usr\bin;C:\ProxSpace\msys2\mingw32\bin;C:\ProxSpace\gcc-arm-none-eabi\bin;c:\Python38;c:\Python38\Scripts;$env:Path"
|
|
|
|
$env:MINGW_HOME="C:\ProxSpace\msys2\mingw32"
|
|
|
|
$env:MSYS_HOME="C:\ProxSpace\msys2"
|
|
|
|
$env:MSYSTEM="MINGW32"
|
|
|
|
$env:MINGW_PREFIX="/mingw32"
|
|
|
|
$env:SHELL="/bin/bash"
|
|
|
|
$env:MSYSTEM_CHOST="i686-w64-mingw32"
|
|
|
|
cd C:\ProxSpace\pm3
|
|
|
|
Write-Host "---------- make ----------" -ForegroundColor Yellow
|
|
|
|
$TestTime=[System.Environment]::TickCount
|
|
|
|
#make
|
|
|
|
bash -c -i 'echo $PATH;pwd;make clean;make V=1'
|
|
|
|
|
|
#some checks
|
|
|
|
if(!(Test-Path C:\ProxSpace\pm3\client\proxmark3.exe)){
|
|
|
|
throw "Main file proxmark3.exe not exists."
|
|
|
|
}
|
|
|
|
cd c:\ProxSpace\pm3
|
|
|
|
bash -c -i 'make check'
|
|
|
|
$testspass = ($LASTEXITCODE -eq 0)
|
|
|
|
$global:TestsPassed=$testspass
|
|
|
|
if ($testspass) {
|
|
Add-AppveyorTest -Name "make Tests" -Framework NUnit -Filename "make check" -Outcome Passed -Duration "$([System.Environment]::TickCount-$TestTime)"
|
|
Write-Host "make Tests [ OK ]" -ForegroundColor Green
|
|
} else {
|
|
Add-AppveyorTest -Name "make Tests" -Framework NUnit -Filename "make check" -Outcome Failed -Duration "$([System.Environment]::TickCount-$TestTime)"
|
|
Write-Host "make Tests [ ERROR ]" -ForegroundColor Red
|
|
throw "Tests error."
|
|
}
|
|
|
|
Write-Host "---------- btaddon ----------" -ForegroundColor Yellow
|
|
|
|
$TestTime=[System.Environment]::TickCount
|
|
|
|
bash -c -i 'pwd;make clean;make PLATFORM_EXTRAS=BTADDON'
|
|
|
|
cd c:\ProxSpace\pm3
|
|
|
|
bash -c -i 'make check'
|
|
|
|
$testspass = ($LASTEXITCODE -eq 0)
|
|
|
|
$global:TestsPassed=(($global:TestsPassed) -and ($testspass))
|
|
|
|
if ($testspass) {
|
|
Add-AppveyorTest -Name "BTaddon Tests" -Framework NUnit -Filename "make check" -Outcome Passed -Duration "$([System.Environment]::TickCount-$TestTime)"
|
|
Write-Host "BTaddon Tests [ OK ]" -ForegroundColor Green
|
|
} else {
|
|
Add-AppveyorTest -Name "BTaddon Tests" -Framework NUnit -Filename "make check" -Outcome Failed -Duration "$([System.Environment]::TickCount-$TestTime)"
|
|
Write-Host "BTaddon Tests [ ERROR ]" -ForegroundColor Red
|
|
}
|
|
|
|
Write-Host "---------- make clean ----------" -ForegroundColor Yellow
|
|
|
|
bash -c -i 'make clean'
|
|
|
|
Write-Host "---------- cmake ----------" -ForegroundColor Yellow
|
|
|
|
$TestTime=[System.Environment]::TickCount
|
|
|
|
cmd.exe /c 'C:\ProxSpace\msys2\msys2_shell.cmd -mingw32 -defterm -no-start -c "mkdir -p client/build; cd client/build; cmake -G""MSYS Makefiles"" ..; make VERBOSE=1;"'
|
|
|
|
Write-Host "---------- cmake tests ----------" -ForegroundColor Yellow
|
|
|
|
cd c:\ProxSpace\pm3
|
|
|
|
bash -c -i './tools/pm3_tests.sh --clientbin client/build/proxmark3.exe client'
|
|
|
|
$testspass = ($LASTEXITCODE -eq 0)
|
|
|
|
$global:TestsPassed=(($global:TestsPassed) -and ($testspass))
|
|
|
|
if ($testspass) {
|
|
Add-AppveyorTest -Name "cmake Tests" -Framework NUnit -Filename "make client/check" -Outcome Passed -Duration "$([System.Environment]::TickCount-$TestTime)"
|
|
Write-Host "cmake Tests [ OK ]" -ForegroundColor Green
|
|
} else {
|
|
Add-AppveyorTest -Name "cmake Tests" -Framework NUnit -Filename "make client/check" -Outcome Failed -Duration "$([System.Environment]::TickCount-$TestTime)"
|
|
Write-Host "cmake Tests [ ERROR ]" -ForegroundColor Red
|
|
}
|
|
|
|
test_script:
|
|
- ps: >-
|
|
if ($global:TestsPassed) {
|
|
Write-Host "Tests [ OK ]" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "Tests [ ERROR ]" -ForegroundColor Red
|
|
throw "Tests error."
|
|
}
|
|
on_success:
|
|
- ps: Write-Host "Build success..." -ForegroundColor Green
|
|
on_failure:
|
|
- ps: Write-Host "Build error." -ForegroundColor Red
|
|
on_finish:
|
|
- ps: # $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|