Travis: CI improvements and fixing edge builds (#766)

- Fix release notes by using edge deploy provider, see: https://github.com/travis-ci/dpl/pull/1069
- Deploy only on master branch
- Move to arm64-graviton2
- Rename debian -> ubuntu
- Remove appveyor.yml
- Remove redundant deploy stage in build step names
- Get rid of bash code in files using sh, and explicitly use bash in sign-macos.sh script
- Add missing newline to build-windows.sh
- Build x86 for Windows
- Enable OpenMP in test builds
- Disable sanitizers on macOS test build
- Disallow failures on snap build
pull/775/head
Koen Schmeets 2020-10-24 11:08:40 +02:00 committed by GitHub
parent 7035071526
commit 8f509f1452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 89 additions and 70 deletions

View File

@ -3,20 +3,20 @@ dist: xenial
language: c language: c
git: git:
submodules: false submodules: false
stages:
- test
- name: deploy
if: (NOT type IN (pull_request)) AND (branch = master)
jobs: jobs:
allow_failures:
- stage: deploy
name: Snap arm64
include: include:
- stage: test - stage: test
name: macOS test name: macOS
os: osx os: osx
osx_image: xcode12.2 osx_image: xcode12.2
install: ".travis/install-macos.sh" install: ".travis/install-macos.sh"
script: ".travis/build-macos.sh" script: ".travis/build-macos.sh"
- stage: deploy - stage: deploy
name: macOS deploy name: macOS
if: (NOT type IN (pull_request)) AND (branch = master)
os: osx os: osx
osx_image: xcode12.2 osx_image: xcode12.2
install: ".travis/install-macos.sh" install: ".travis/install-macos.sh"
@ -33,24 +33,25 @@ jobs:
skip_cleanup: true skip_cleanup: true
prerelease: true prerelease: true
overwrite: true overwrite: true
edge: true
name: ${TRAVIS_TAG:-edge} name: ${TRAVIS_TAG:-edge}
body: $TRAVIS_COMMIT_MESSAGE release_notes: $TRAVIS_COMMIT_MESSAGE
file: build/bin/SolveSpace.dmg file: build/bin/SolveSpace.dmg
on: on:
repo: solvespace/solvespace repo: solvespace/solvespace
- stage: test - stage: test
name: "Debian" name: "Ubuntu"
os: linux os: linux
dist: bionic dist: bionic
install: .travis/install-debian.sh install: .travis/install-ubuntu.sh
script: .travis/build-debian.sh script: .travis/build-ubuntu.sh
- stage: test - stage: test
name: "Windows Visual Studio 2017 test" name: "Windows"
os: windows os: windows
install: .travis/install-windows.sh install: .travis/install-windows.sh
script: .travis/build-windows.sh script: .travis/build-windows.sh
- stage: deploy - stage: deploy
name: "Windows Visual Studio 2017 deploy" name: "Windows"
os: windows os: windows
install: .travis/install-windows.sh install: .travis/install-windows.sh
script: .travis/build-windows.sh release script: .travis/build-windows.sh release
@ -64,14 +65,37 @@ jobs:
token: token:
secure: dDlkIawHcODlW9B/20/cQCtzeoocvs0hKuNngRKXKqzXLWTRq33oq/B7+39tAixWbmv6exTpijiKrRNFiSCW5Z4iwHLwaRD4XJznxw63e/Hus/dxg2Tvqx7XFpkCz8mT1Z+gZQE5YxAngeZPpI/sZbZtF1UO3yH5eLeeokZ15p26ZskQUPoYuzrTgTzYL3XfpG3F+20rNBawH1ycsCTVD/08/n31d2m3CrKAsbW7er92ek6w4fzKr7NW8WeXjrPJETVpw5fQg1Od3pRGW8dPQaJcvKQEogMp8Mm0ETYd0qigg89/giBz7QwOgmAWQ4dH+DfZH4Ojl//127QztBolMvyDMQBykWrtJoGcij05sT6K2IJr2FHeUBO12MAEdjiVvhQj3DtTzjPiZAHHDBSLWxLKWWhlhHE4pq7g1MQhqXkaAHI2BLNzwLmaowbMT0bECf9yfz6xx18h6XPQFX44oOktraobVALFlyHqeKa8zdcUt22LF6uAL1m5dxL0tny3eXCIPE4UH/RZgua/cHV9G3cUvKQa/QnFSLRhvWVSbGB+7YsHouBJcsUOOW1gmd5442XuC7mpppccRldh+GSxUk6TBJRAx7TeQ0ybDUaoco9MUqp2twv3KreR2+8Q12PDaAhfQVNEGdF3wTm1sShImjCN4VN3eSLlBEbve1QRQXM= secure: dDlkIawHcODlW9B/20/cQCtzeoocvs0hKuNngRKXKqzXLWTRq33oq/B7+39tAixWbmv6exTpijiKrRNFiSCW5Z4iwHLwaRD4XJznxw63e/Hus/dxg2Tvqx7XFpkCz8mT1Z+gZQE5YxAngeZPpI/sZbZtF1UO3yH5eLeeokZ15p26ZskQUPoYuzrTgTzYL3XfpG3F+20rNBawH1ycsCTVD/08/n31d2m3CrKAsbW7er92ek6w4fzKr7NW8WeXjrPJETVpw5fQg1Od3pRGW8dPQaJcvKQEogMp8Mm0ETYd0qigg89/giBz7QwOgmAWQ4dH+DfZH4Ojl//127QztBolMvyDMQBykWrtJoGcij05sT6K2IJr2FHeUBO12MAEdjiVvhQj3DtTzjPiZAHHDBSLWxLKWWhlhHE4pq7g1MQhqXkaAHI2BLNzwLmaowbMT0bECf9yfz6xx18h6XPQFX44oOktraobVALFlyHqeKa8zdcUt22LF6uAL1m5dxL0tny3eXCIPE4UH/RZgua/cHV9G3cUvKQa/QnFSLRhvWVSbGB+7YsHouBJcsUOOW1gmd5442XuC7mpppccRldh+GSxUk6TBJRAx7TeQ0ybDUaoco9MUqp2twv3KreR2+8Q12PDaAhfQVNEGdF3wTm1sShImjCN4VN3eSLlBEbve1QRQXM=
skip_cleanup: true skip_cleanup: true
draft: true
prerelease: true prerelease: true
overwrite: true overwrite: true
edge: true
name: ${TRAVIS_TAG:-edge} name: ${TRAVIS_TAG:-edge}
body: $TRAVIS_COMMIT_MESSAGE release_notes: $TRAVIS_COMMIT_MESSAGE
file: build/bin/RelWithDebInfo/solvespace.exe file: build/bin/RelWithDebInfo/solvespace.exe
on: on:
repo: solvespace/solvespace repo: solvespace/solvespace
- stage: deploy
name: "Windows with OpenMP"
os: windows
install: .travis/install-windows.sh
script: .travis/build-windows.sh release openmp
before_deploy:
- git config --local user.name "solvespace-cd"
- git config --local user.email "no-reply@solvespace.com"
- export TRAVIS_TAG=${TRAVIS_TAG:-edge}
- git tag $TRAVIS_TAG
deploy:
provider: releases
token:
secure: dDlkIawHcODlW9B/20/cQCtzeoocvs0hKuNngRKXKqzXLWTRq33oq/B7+39tAixWbmv6exTpijiKrRNFiSCW5Z4iwHLwaRD4XJznxw63e/Hus/dxg2Tvqx7XFpkCz8mT1Z+gZQE5YxAngeZPpI/sZbZtF1UO3yH5eLeeokZ15p26ZskQUPoYuzrTgTzYL3XfpG3F+20rNBawH1ycsCTVD/08/n31d2m3CrKAsbW7er92ek6w4fzKr7NW8WeXjrPJETVpw5fQg1Od3pRGW8dPQaJcvKQEogMp8Mm0ETYd0qigg89/giBz7QwOgmAWQ4dH+DfZH4Ojl//127QztBolMvyDMQBykWrtJoGcij05sT6K2IJr2FHeUBO12MAEdjiVvhQj3DtTzjPiZAHHDBSLWxLKWWhlhHE4pq7g1MQhqXkaAHI2BLNzwLmaowbMT0bECf9yfz6xx18h6XPQFX44oOktraobVALFlyHqeKa8zdcUt22LF6uAL1m5dxL0tny3eXCIPE4UH/RZgua/cHV9G3cUvKQa/QnFSLRhvWVSbGB+7YsHouBJcsUOOW1gmd5442XuC7mpppccRldh+GSxUk6TBJRAx7TeQ0ybDUaoco9MUqp2twv3KreR2+8Q12PDaAhfQVNEGdF3wTm1sShImjCN4VN3eSLlBEbve1QRQXM=
skip_cleanup: true
prerelease: true
overwrite: true
edge: true
name: ${TRAVIS_TAG:-edge}
release_notes: $TRAVIS_COMMIT_MESSAGE
file: build/bin/RelWithDebInfo/solvespace-openmp.exe
on:
repo: solvespace/solvespace
- &deploy-snap - &deploy-snap
stage: deploy stage: deploy
name: Snap amd64 name: Snap amd64
@ -98,4 +122,6 @@ jobs:
tags: true tags: true
- <<: *deploy-snap - <<: *deploy-snap
name: Snap arm64 name: Snap arm64
arch: arm64 arch: arm64-graviton2
group: edge
virt: lxd

View File

@ -1,11 +0,0 @@
#!/bin/sh -xe
if echo $TRAVIS_TAG | grep ^v; then BUILD_TYPE=RelWithDebInfo; else BUILD_TYPE=Debug; fi
mkdir build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DENABLE_SANITIZERS=ON
make -j$(nproc) VERBOSE=1
make test_solvespace

View File

@ -11,18 +11,22 @@ export LDFLAGS="-L${LLVM_PREFIX}/lib -Wl,-rpath,${LLVM_PREFIX}/lib" \
export CFLAGS="-I${LLVM_PREFIX}/include" export CFLAGS="-I${LLVM_PREFIX}/include"
export CPPFLAGS="-I${LLVM_PREFIX}/include" export CPPFLAGS="-I${LLVM_PREFIX}/include"
if [ "$1" == "release" ]; then if [ "$1" = "release" ]; then
BUILD_TYPE=RelWithDebInfo BUILD_TYPE=RelWithDebInfo
cmake \ cmake \
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_TARGET}" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_TARGET}" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" .. \ -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DENABLE_OPENMP=ON \ -DENABLE_OPENMP="ON" \
-DENABLE_LTO=ON -DENABLE_LTO="ON" \
..
else else
BUILD_TYPE=Debug BUILD_TYPE=Debug
cmake \ cmake \
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_TARGET}" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_TARGET}" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" .. -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DENABLE_OPENMP="ON" \
-DENABLE_SANITIZERS="ON" \
..
fi fi
cmake --build . --config "${BUILD_TYPE}" -- -j$(nproc) cmake --build . --config "${BUILD_TYPE}" -- -j$(nproc)

11
.travis/build-ubuntu.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh -xe
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE="Debug" \
-DENABLE_OPENMP="ON" \
-DENABLE_SANITIZERS="ON" \
..
make -j$(nproc) VERBOSE=1
make test_solvespace

View File

@ -6,20 +6,34 @@ export PATH=$MSBUILD_PATH:$PATH
mkdir build mkdir build
cd build cd build
if [ "$1" == "release" ]; then if [ "$1" = "release" ]; then
if [ "$2" = "openmp" ]; then
ENABLE_OPENMP="ON"
else
ENABLE_OPENMP="OFF"
fi
BUILD_TYPE=RelWithDebInfo BUILD_TYPE=RelWithDebInfo
cmake \ cmake \
-G "Visual Studio 15 2017 Win64" \ -G "Visual Studio 15 2017" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" .. \ -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DENABLE_OPENMP=ON \ -DENABLE_OPENMP="${ENABLE_OPENMP}" \
-DENABLE_LTO=ON -DENABLE_LTO=ON \
-DCMAKE_GENERATOR_PLATFORM="Win32" \
..
else else
BUILD_TYPE=Debug BUILD_TYPE=Debug
cmake \ cmake \
-G "Visual Studio 15 2017 Win64" \ -G "Visual Studio 15 2017" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" .. -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DENABLE_OPENMP="ON" \
-DCMAKE_GENERATOR_PLATFORM="Win32" \
..
fi fi
cmake --build . --config "${BUILD_TYPE}" -- -maxcpucount cmake --build . --config "${BUILD_TYPE}" -- -maxcpucount
bin/$BUILD_TYPE/solvespace-testsuite.exe bin/$BUILD_TYPE/solvespace-testsuite.exe
if [ "$2" = "openmp" ]; then
mv bin/$BUILD_TYPE/solvespace.exe bin/$BUILD_TYPE/solvespace-openmp.exe
fi

View File

@ -1,4 +1,4 @@
#!/bin/sh -xe #!/bin/bash -xe
cd build cd build

View File

@ -170,7 +170,11 @@ if(ENABLE_SANITIZERS)
endif() endif()
string(REPLACE ";" "," SANITIZE_OPTIONS "${SANITIZE_OPTIONS}") string(REPLACE ";" "," SANITIZE_OPTIONS "${SANITIZE_OPTIONS}")
if (NOT APPLE)
set(SANITIZE_FLAGS "-O1;-fsanitize=${SANITIZE_OPTIONS};-fno-sanitize-recover=address,undefined") set(SANITIZE_FLAGS "-O1;-fsanitize=${SANITIZE_OPTIONS};-fno-sanitize-recover=address,undefined")
else()
set(SANITIZE_FLAGS "-O1;-fsanitize=${SANITIZE_OPTIONS}")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
list(APPEND SANITIZE_FLAGS -fno-omit-frame-pointer -fno-optimize-sibling-calls) list(APPEND SANITIZE_FLAGS -fno-omit-frame-pointer -fno-optimize-sibling-calls)

View File

@ -1,29 +0,0 @@
version: '{build}'
clone_depth: 1
before_build:
- git submodule update --init
- set tag=x%APPVEYOR_REPO_TAG_NAME%
- if %tag:~,2% == xv (set BUILD_TYPE=RelWithDebInfo) else (set BUILD_TYPE=Debug)
- mkdir build
- cmake -G"Visual Studio 14" -Tv140 -Bbuild -H.
build_script:
- msbuild "build\src\solvespace.vcxproj" /verbosity:minimal /property:Configuration=%BUILD_TYPE% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- msbuild "build\src\solvespace-cli.vcxproj" /verbosity:minimal /property:Configuration=%BUILD_TYPE% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- msbuild "build\test\solvespace-testsuite.vcxproj" /verbosity:minimal /property:Configuration=%BUILD_TYPE% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
test_script:
- build\bin\%BUILD_TYPE%\solvespace-testsuite.exe
artifacts:
- path: build\bin\%BUILD_TYPE%\solvespace.exe
name: solvespace.exe
- path: build\bin\%BUILD_TYPE%\solvespace-cli.exe
name: solvespace-cli.exe
- path: build\bin\%BUILD_TYPE%\solvespace.pdb
name: solvespace.pdb
deploy:
- provider: GitHub
auth_token:
secure: P9/pf2nM+jlWKe7pCjMp41HycBNP/+5AsmE/TETrDUoBOa/9WFHelqdVFrbRn9IC
description: ""
artifact: solvespace.exe,solvespace-cli.exe,solvespace.pdb
on:
appveyor_repo_tag: true