From fad2f56d9669a6af80966bc7bdee90453fc9331e Mon Sep 17 00:00:00 2001 From: Frizi Date: Sat, 21 Sep 2019 15:29:50 +0200 Subject: [PATCH] Switch windows, linux and macos to jenkins CI --- .travis.yml | 32 +++++++++++++++++--------------- Jenkinsfile | 48 +++++++++++++++++++++++++++++++++--------------- bors.toml | 7 +++---- rendy/Cargo.toml | 12 ++++++------ 4 files changed, 59 insertions(+), 40 deletions(-) diff --git a/.travis.yml b/.travis.yml index 32d7fae0..9e7cdc66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: rust compiler: clang +cache: cargo env: global: RUSTFLAGS="-D warnings" RUST_LOG=info @@ -8,16 +9,16 @@ rust: stable matrix: include: - # Linux 64bit - - os: linux + # # Linux 64bit + # - os: linux - # macOS 64bit - - env: MACOSX_DEPLOYMENT_TARGET=10.9 - os: osx - osx_image: xcode10.2 - # We need travis_wait here to ensure the build doesn't timeout due to - # shader compilation - script: travis_wait 30 make + # # macOS 64bit + # - env: MACOSX_DEPLOYMENT_TARGET=10.9 + # os: osx + # osx_image: xcode10.2 + # # We need travis_wait here to ensure the build doesn't timeout due to + # # shader compilation + # script: travis_wait 30 make # iPhoneOS 64bit - env: TARGET=aarch64-apple-ios @@ -25,17 +26,18 @@ matrix: osx_image: xcode10.2 # We need travis_wait here to ensure the build doesn't timeout due to # shader compilation - script: travis_wait 30 make + script: travis_wait 45 make - # Windows 64bit - - os: windows - env: PATH=/c/Python37:/c/Python37/Scripts:$PATH + # # Windows 64bit + # - os: windows + # env: PATH=/c/Python37:/c/Python37/Scripts:$PATH branches: only: - - staging - - trying + # Only build on master as sanity check - master + # - staging + # - trying before_install: - if [[ $TRAVIS_OS_NAME == "windows" ]]; then choco install make; choco install ninja; choco install python; fi diff --git a/Jenkinsfile b/Jenkinsfile index 34d46b71..714f7290 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,20 +26,7 @@ pipeline { } stage('Run Tests') { parallel { - stage("Test on Linux") { - agent { - docker { - image 'amethystrs/builder-linux:stable' - label 'docker' - } - } - steps { - echo 'Beginning tests...' - sh 'cd rendy && cargo test --all --features "full vulkan"' - echo 'Tests done!' - } - } - stage('Coverage') { + stage('Test on Linux / coverage') { agent { docker { image 'amethystrs/builder-linux:stable' @@ -50,7 +37,7 @@ pipeline { steps { withCredentials([string(credentialsId: 'codecov_token', variable: 'CODECOV_TOKEN')]) { echo 'Building to calculate coverage' - sh 'cargo test --all' + sh 'cd rendy && cargo test --all --features "full vulkan"' echo 'Calculating code coverage...' sh 'for file in target/debug/rendy*[^\\.d]; do mkdir -p \"target/cov/$(basename $file)\"; kcov --exclude-pattern=/.cargo,/usr/lib --verify \"target/cov/$(basename $file)\" \"$file\" || true; done' echo "Uploading coverage..." @@ -59,6 +46,37 @@ pipeline { } } } + stage("Test on Windows") { + environment { + CARGO_HOME = 'C:\\Users\\root\\.cargo' + RUSTUP_HOME = 'C:\\Users\\root\\.rustup' + } + agent { + label 'windows' + } + steps { + bat 'C:\\Users\\root\\.cargo\\bin\\cargo update' + echo 'Beginning tests...' + // TODO: Once we support DX12, we should switch to it from vulkan for windows + // FIXME: Can't test "full" because of problems with shaderc compilation on windows box + bat 'cd rendy && C:\\Users\\root\\.cargo\\bin\\cargo test --all --no-default-features --features "base mesh-obj texture-image texture-palette spirv-reflection wsi-winit serde-1 vulkan"' + echo 'Tests done!' + } + } + stage("Test on macOS") { + environment { + CARGO_HOME = '/Users/jenkins/.cargo' + RUSTUP_HOME = '/Users/jenkins/.rustup' + } + agent { + label 'mac' + } + steps { + echo 'Beginning tests...' + sh 'cd rendy && /Users/jenkins/.cargo/bin/cargo test --all --features "full metal"' + echo 'Tests done!' + } + } } } } diff --git a/bors.toml b/bors.toml index 81e394a6..54275798 100644 --- a/bors.toml +++ b/bors.toml @@ -1,6 +1,5 @@ +# Test suite must pass on both Travis (if enabled) and Jenkins before merging into `master`. status = [ - "continuous-integration/travis-ci/push" + # "continuous-integration/travis-ci/push", + "continuous-integration/jenkins/%", ] -# Uncomment this to use a two hour timeout. -# The default is one hour. -#timeout_sec = 7200 diff --git a/rendy/Cargo.toml b/rendy/Cargo.toml index b324f7ed..d111d6a4 100644 --- a/rendy/Cargo.toml +++ b/rendy/Cargo.toml @@ -48,7 +48,7 @@ spirv-reflection = ["rendy-shader/spirv-reflection" ] wsi-winit = ["rendy-wsi/winit"] # Full feature set - all listed features except rendy-util's. -full = ["base", "mesh-obj", "texture-image", "texture-palette", "spirv-reflection", "shader-compiler", "wsi-winit"] +full = ["base", "mesh-obj", "texture-image", "texture-palette", "spirv-reflection", "shader-compiler", "wsi-winit", "serde-1"] # Default feature set includes all subcrates and few commonly used features. default = [ "base", "shader-compiler", "spirv-reflection", "wsi-winit" ] @@ -82,23 +82,23 @@ rand = "0.7" [[example]] name = "triangle" -required-features = ["base", "wsi-winit"] +required-features = ["base", "wsi-winit", "shader-compiler"] [[example]] name = "sprite" -required-features = ["base", "texture-image", "wsi-winit"] +required-features = ["base", "texture-image", "wsi-winit", "shader-compiler"] [[example]] name = "meshes" -required-features = ["base", "wsi-winit"] +required-features = ["base", "wsi-winit", "shader-compiler"] [[example]] name = "quads" -required-features = ["base", "wsi-winit"] +required-features = ["base", "wsi-winit", "shader-compiler"] [[example]] name = "source_shaders" -required-features = ["base", "wsi-winit"] +required-features = ["base", "wsi-winit", "shader-compiler"] [package.metadata.docs.rs] features = ["full"]