Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continous Integration System #2211

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
cache:
- C:\ProgramData\chocolatey\bin
- C:\ProgramData\chocolatey\lib

image:
- Visual Studio 2013
- Visual Studio 2015
# - Visual Studio 2017

environment:
github_token:
secure: 1Z6WAhrXFRCDiR9sDl9GLpd2yHaC4QxVwOuihLqfhn9oigDyFFlj6ek6+0VoEbGH
github_email:
secure: 83W6QhzZVYQ4Zca5GpbATA==
matrix:
- additional_cmake_args: "-DTORQUE_PHYSICS_BULLET=on -DTORQUE_TESTING=on"
bin_deployable_conf: "true"
- additional_cmake_args: "-DTORQUE_PHYSICS_BULLET=on -DTORQUE_OPENGL=on -DTORQUE_TESTING=on"
additional_build_args: "--config Release"
doxydoc_deployable_conf: "true"
testable_conf: "true"

platform:
- i386
- amd64

#init:
# enable RDP
#- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

install:
- ps: . .\Tools\appveyor\install.ps1

build_script:
- ps: . .\Tools\appveyor\build.ps1

test_script:
- ps: if ($env:testable_conf -eq "true") {. .\Tools\appveyor\test.ps1 }

after_test:
- ps: . .\Tools\appveyor\prepareDeployment.ps1

artifacts:
- path: $(bundle_name)

deploy:
release: Torque3D
provider: GitHub
tag: $(appveyor_repo_tag_name)
auth_token:
secure: 1Z6WAhrXFRCDiR9sDl9GLpd2yHaC4QxVwOuihLqfhn9oigDyFFlj6ek6+0VoEbGH
draft: false
force_update: true
on:
bin_deploy_condition: true

on_finish:
- ps: get-childItem .\*.png | % { push-appveyorArtifact $_.fullName -fileName $_.name }
- ps: if ($env:doxydoc_deploy_condition -eq "true") { . .\Tools\appveyor\deployToGithubPages.ps1 }
51 changes: 51 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
matrix:
include:
- os: linux
dist: trusty
sudo: required
services: docker
env: OS_ID="ubuntu-latest-lts" ADDITIONAL_CMAKE_ARGS="-DTORQUE_PHYSICS_BULLET=on -DTORQUE_TESTING=on" DEPLOYABLE_CONF=true
compiler: gcc
# - os: osx
# env: ADDITIONAL_CMAKE_ARGS="-DTORQUE_TESTING=off -DTORQUE_PHYSICS_BULLET=off" DEPLOYABLE_CONF=true CXXFLAGS="-fgnu-inline-asm -fasm-blocks"
# osx_image: xcode9
# compiler: clang
# - os: osx
# env: ADDITIONAL_CMAKE_ARGS="-DTORQUE_TESTING=off -DTORQUE_PHYSICS_BULLET=off" DEPLOYABLE_CONF=true CXXFLAGS="fgnu-inline-asm -fasm-blocks"
# osx_image: xcode8.3
# compiler: clang
- os: osx
env: ADDITIONAL_CMAKE_ARGS="-DTORQUE_TESTING=off -DTORQUE_PHYSICS_BULLET=on" DEPLOYABLE_CONF=true #CXXFLAGS="-fgnu-inline-asm -fasm-blocks"
osx_image: xcode8
compiler: clang
# - os: osx
# env: ADDITIONAL_CMAKE_ARGS="-DTORQUE_TESTING=off -DTORQUE_PHYSICS_BULLET=on" DEPLOYABLE_CONF=true CXXFLAGS="-fgnu-inline-asm -fasm-blocks"
# osx_image: xcode7.3
# compiler: clang

language: cpp

install:
- source ./Tools/travis/install.sh

script:
- |
if [[ $TRAVIS_OS_NAME = linux ]];then
docker_exec ./Tools/travis/script.sh
else
./Tools/travis/script.sh
fi

before_deploy:
- source ./Tools/travis/beforeDeploy.sh

deploy:
provider: releases
api_key:
secure: nA4UTb1jcypzxbRsioMc2LObsTd+DR6mjHdj1a4zGxrDe8o8cxE9NLwkIeJp2dPB5tuLXazghh4k3KyurwMKcg3IEfn7vGDMyd+PhD4p4SXQT/pEPNwaQiBGAKPmABqN7DSCeluEbM0VpOZVsXSnXQGFYy6jB1TlXYORDJ5vIMHj8tdc0YH1wY0LQw3QjEZeS9Oq1v2HdXGFGvoHV5FvOcy6TskbhTbUIUhalan9+iB/xS5zGmpNJwzI6G7i9HEdD4mfKdyQ4JAxHMB78ApcfNyqHfkYa/T3d7Hi7pxPS2xRzu1gZL6ux0oFuJbYHH83k9D+cBM0rQtW78aTl0qn4v1qw1L9TUIr/Ji2hu3XEKbTIfoOG+Rr0cC2m4ZaTJNh2RTUoA7gsK+/lor6rGEvoMPj7sfKhQcCzRuJ2kDUHjwJBqU11OrSQ13y3tJY0U7b0UBdYhSk3n7QqYVfH3WFMa57VfmsOHvD99FW/j6aRzPSavtK5os7FNtaIkpKYwoYQUe5Cw3nOy3TEh4D0QnANezUDmEXG3uq0fCwAzW+WrJ/GaegegiPuFKP72wwKJ0MmTbFQH6iH5VFJsWM6pBRiPegvnxIJd25YoYgtrqQoOoDRfZ0W2iIoWZbfXUoeLrFy2kuOA1yT4rI5pDIuMsz4XjxyXgAHZtxGjYsvPUPEhY=
file: "My Projects/Torque3D/game/${BUNDLE_NAME}"
skip_cleanup: true
overwrite: true
on:
all_branches: true
condition: $DEPLOY_CONDITION
28 changes: 28 additions & 0 deletions Tools/appveyor/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Set-PSDebug -Trace 1

switch -wildcard ($env:appveyor_build_worker_image)
{
"*2013" { $env:generator="Visual Studio 12 2013" }
"*2015" { $env:generator="Visual Studio 14 2015" }
"*2017" { $env:generator="Visual Studio 15 2017" }
default { throw "Unkown Worker Image!" }
}
if ($env:platform -eq "amd64"){
$env:generator=$env:generator + " Win64"
}

mkdir -p "My Projects\Torque3D\buildFiles\CMake"
pushd "My Projects\Torque3D\buildFiles\CMake"
cmake ..\..\..\..\ -G $env:generator -DTORQUE_APP_NAME=Torque3D $env:additional_cmake_args
exec { iex "cmake --build . --target install $env:additional_build_args" }
popd

if ($env:doxydoc_deploy_condition -eq "true"){
pushd "Tools\doxygen\"
. .\generateInput.ps1
doxygen engineReference.cfg
doxygen scriptReference.cfg
popd
}

powershell -file $env:toolsdir\appveyor\takeScreenshot.ps1
16 changes: 16 additions & 0 deletions Tools/appveyor/deployToGithubPages.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Set-PSDebug -Trace 1

git config --global credential.helper store
add-content "$env:USERPROFILE\.git-credentials" "https://$($env:github_token):x-oauth-basic@github.com`n"
git config --global user.email $env:github_email
git config --global user.name "andijh92"

# copy right doc dir to gh-pages branch
git add doc\$env:appveyor_repo_tag_name
git commit -m "added generated doc for pushing to gh-pages branch"
git branch tmp-doc
git checkout -q gh-pages
git checkout tmp-doc -- doc\$env:appveyor_repo_tag_name

git commit -m "added generated doc"
git push -q origin gh-pages
33 changes: 33 additions & 0 deletions Tools/appveyor/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Set-PSDebug -Trace 1

function exec([scriptblock]$cmd, [string]$errorMessage = "Error executing command: " + $cmd){
& $cmd
if ($LastExitCode -ne 0) {
throw $errorMessage
}
}

if ($env:appveyor_repo_branch -eq "development"){
$env:appveyor_repo_tag="true"
$env:appveyor_repo_tag_name="dev"
}

if ($env:appveyor_repo_tag -and
($env:appveyor_build_worker_image -eq "Visual Studio 2015"))
{
if($env:bin_deployable_conf){
$env:bin_deploy_condition="true"
}
if($env:doxydoc_deployable_conf -and
($env:platform -eq "i386")){
$env:doxydoc_deploy_condition="true"
}
}

if($env:doxydoc_deploy_condition -eq "true"){
exec { choco install -y doxygen.portable graphviz }
}

$env:rootdir=$env:appveyor_build_folder
$env:gamedir="$env:rootdir\My Projects\Torque3D\game"
$env:toolsdir="$env:rootdir\Tools"
15 changes: 15 additions & 0 deletions Tools/appveyor/prepareDeployment.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# make bin bundle
pushd $env:gamedir
if ($env:appveyor_repo_tag_name -eq "dev"){
echo "The last commit was $env:appveyor_repo_commit when compiling this binary." > VERSION
}
$env:bundle_name="Torque3D-${env:appveyor_repo_tag_name}-Win-${env:platform}.zip"
7z a $env:bundle_name *
mv $env:bundle_name $env:rootdir
popd

# mv doxygen output
mkdir -p doc\$env:appveyor_repo_tag_name
mv $env:toolsdir\doxygen\output\* doc\$env:appveyor_repo_tag_name
rm doc\.gitignore
rm doc\$env:appveyor_repo_tag_name\.gitignore
28 changes: 28 additions & 0 deletions Tools/appveyor/takeScreenshot.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# from https://github.com/FeodorFitsner/selenium-tests/blob/master/take-screenshot.ps1 Thanks!

[Reflection.Assembly]::LoadWithPartialName("System.Drawing")
function screenshot([Drawing.Rectangle]$bounds, $path) {
$bmp = New-Object Drawing.Bitmap $bounds.width, $bounds.height
$graphics = [Drawing.Graphics]::FromImage($bmp)

$graphics.CopyFromScreen($bounds.Location, [Drawing.Point]::Empty, $bounds.size)

$bmp.Save($path)

$graphics.Dispose()
$bmp.Dispose()
}

#NUC bounds
$bounds = [Drawing.Rectangle]::FromLTRB(0, 0, 1280, 800)

#remote display bounds
#$bounds = [Drawing.Rectangle]::FromLTRB(0, 0, 1280, 800)

$PC_name=$(Get-WmiObject Win32_Computersystem).name

$dateandtime = Get-Date -Format yyyy-MM-dd-hh-mm-ss

$path_pcname= "$env:appveyor_build_folder\" + $PC_name + "_screenshot_" + "$dateandtime"+ ".png"

screenshot $bounds $path_pcname
7 changes: 7 additions & 0 deletions Tools/appveyor/test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pushd $env:gamedir
.\Torque3*.exe runTests.cs
start-sleep -seconds 120
powershell -file $env:toolsdir\appveyor\takeScreenshot.ps1
mv console.log unitTests.log
push-appveyorArtifact unitTests.log
popd
3 changes: 3 additions & 0 deletions Tools/doxygen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.log

/*.tag
6 changes: 6 additions & 0 deletions Tools/doxygen/dumpScriptDoc.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
enableWinConsole(true);
exec("core/scripts/client/scriptDoc.cs");
writeOutFunctions();
writeOutClasses();
dumpEngineDocs("scriptModules.txt");
quit();
Loading