From a2c0be6da281c9e638d8566f2b8db3b3ffd9de22 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 27 Jan 2019 15:19:59 +0100 Subject: [PATCH 1/5] Add travis and appveyor scripts --- .appveyor.yml | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 30 +++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 .appveyor.yml create mode 100644 .travis.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 00000000..cd9de0e3 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,72 @@ +branches: + only: + - staging + - trying + - master + - /z_post_*/ + +# Appveyor configuration template for Rust using rustup for Rust installation +# https://github.com/starkat99/appveyor-rust + +## Operating System (VM environment) ## + +# Rust needs at least Visual Studio 2013 Appveyor OS for MSVC targets. +os: Visual Studio 2015 + +## Build Matrix ## +environment: + matrix: + +### MSVC Toolchains ### + # Nightly 64-bit MSVC + - channel: nightly + target: x86_64-pc-windows-msvc + MSYS_BITS: 64 + # Nightly 32-bit MSVC + - channel: nightly + target: i686-pc-windows-msvc + MSYS_BITS: 32 + +### GNU Toolchains ### + # Nightly 64-bit GNU + - channel: nightly + target: x86_64-pc-windows-gnu + MSYS_BITS: 64 + # Nightly 32-bit GNU + - channel: nightly + target: i686-pc-windows-gnu + MSYS_BITS: 32 + +cache: + - '%USERPROFILE%\.cargo\bin' + - '%USERPROFILE%\.cargo\.crates.toml' + +## Install Script ## + +# This is the most important part of the Appveyor configuration. This installs the version of Rust +# specified by the 'channel' and 'target' environment variables from the build matrix. This uses +# rustup to install Rust. +# +# For simple configurations, instead of using the build matrix, you can simply set the +# default-toolchain and default-host manually here. +install: + - appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe + - rustup-init -yv --default-toolchain %channel% --default-host %target% + - set PATH=%PATH%;%USERPROFILE%\.cargo\bin + - rustc -vV + - cargo -vV + +## Build Script ## + +# 'cargo test' takes care of building for us, so disable Appveyor's build stage. This prevents +# the "directory does not contain a project or solution file" error. +build: false + +before_test: + - set PATH=C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH% + # Fix undefined references to __acrt_iob_func() + - sed -rie "s/#define std([[:alpha:]]+)[[:space:]]+\(__acrt_iob_func\(([[:digit:]]+)\)\)/#define std\1 (\&__iob_func()[\2])/" "C:\msys64\mingw64\x86_64-w64-mingw32\include\stdio.h" + - sed -rie "s/#define std([[:alpha:]]+)[[:space:]]+\(__acrt_iob_func\(([[:digit:]]+)\)\)/#define std\1 (\&__iob_func()[\2])/" "C:\msys64\mingw32\i686-w64-mingw32\include\stdio.h" + +test_script: + - cargo --version diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..7b23b61e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +language: rust + +rust: + - nightly + +os: + - linux + +notifications: + email: + on_success: never + on_failure: always + +branches: + only: + # This is where pull requests from "bors r+" are built. + - staging + # This is where pull requests from "bors try" are built. + - trying + # Build pull requests. + - master + # Build post braches + - /^z_post_.*$/ + +cache: + directories: + - $HOME/.cargo + +script: + - cargo rustc -- -Z pre-link-arg=-nostartfiles From 8d730050d3e9c21030f5698f3285e6e09e068d74 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 27 Jan 2019 15:27:16 +0100 Subject: [PATCH 2/5] Update CI scripts for second post --- .appveyor.yml | 6 +++++- .travis.yml | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index cd9de0e3..5b68599e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -67,6 +67,10 @@ before_test: # Fix undefined references to __acrt_iob_func() - sed -rie "s/#define std([[:alpha:]]+)[[:space:]]+\(__acrt_iob_func\(([[:digit:]]+)\)\)/#define std\1 (\&__iob_func()[\2])/" "C:\msys64\mingw64\x86_64-w64-mingw32\include\stdio.h" - sed -rie "s/#define std([[:alpha:]]+)[[:space:]]+\(__acrt_iob_func\(([[:digit:]]+)\)\)/#define std\1 (\&__iob_func()[\2])/" "C:\msys64\mingw32\i686-w64-mingw32\include\stdio.h" + - rustup component add rust-src + - set RUST_BACKTRACE=1 + - if not exist %USERPROFILE%\.cargo\bin\cargo-install-latest.exe cargo install cargo-install-latest + - cargo install-latest cargo-xbuild bootimage test_script: - - cargo --version + - bootimage build diff --git a/.travis.yml b/.travis.yml index 7b23b61e..699c60af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ rust: os: - linux + - osx + - windows notifications: email: @@ -26,5 +28,11 @@ cache: directories: - $HOME/.cargo +before_script: + - rustup component add rust-src + - (test -x $HOME/.cargo/bin/cargo-install-latest || cargo install cargo-install-latest) + - cargo install-latest cargo-xbuild bootimage cargo-cache + script: - - cargo rustc -- -Z pre-link-arg=-nostartfiles + - bootimage build + - cargo cache --autoclean From d516dac0c33c4c9f1e76eb8f338790f3b2455273 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 27 Jan 2019 15:41:13 +0100 Subject: [PATCH 3/5] Update CI scripts for unit testing post --- .appveyor.yml | 2 ++ .travis.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index 5b68599e..d9b56030 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -74,3 +74,5 @@ before_test: test_script: - bootimage build + - if %target%==x86_64-pc-windows-gnu cargo test + - if %target%==x86_64-pc-windows-msvc cargo test diff --git a/.travis.yml b/.travis.yml index 699c60af..8819d85b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,4 +35,5 @@ before_script: script: - bootimage build + - cargo test - cargo cache --autoclean From 68d09db7c5e2d8ca8bd2f6f9ff5dba4f8ff08c9a Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 27 Jan 2019 15:46:08 +0100 Subject: [PATCH 4/5] Update CI scripts for integration test post --- .appveyor.yml | 13 +++++++++++++ .travis.yml | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index d9b56030..b5ca909c 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -56,6 +56,18 @@ install: - rustc -vV - cargo -vV + # Install qemu + - echo %cd% + - mkdir "C:\Program Files\qemu" + - cd "C:\Program Files\qemu" + - if %target%==i686-pc-windows-msvc appveyor DownloadFile "https://qemu.weilnetz.de/w32/2018/qemu-w32-setup-20180801.exe" -FileName "qemu-setup.exe" + - if %target%==i686-pc-windows-gnu appveyor DownloadFile "https://qemu.weilnetz.de/w32/2018/qemu-w32-setup-20180801.exe" -FileName "qemu-setup.exe" + - if %target%==x86_64-pc-windows-msvc appveyor DownloadFile "https://qemu.weilnetz.de/w64/2018/qemu-w64-setup-20180801.exe" -FileName "qemu-setup.exe" + - if %target%==x86_64-pc-windows-gnu appveyor DownloadFile "https://qemu.weilnetz.de/w64/2018/qemu-w64-setup-20180801.exe" -FileName "qemu-setup.exe" + - 7z x qemu-setup.exe + - set PATH=%PATH%;C:\Program Files\qemu + - cd "C:\projects\blog-os" + ## Build Script ## # 'cargo test' takes care of building for us, so disable Appveyor's build stage. This prevents @@ -76,3 +88,4 @@ test_script: - bootimage build - if %target%==x86_64-pc-windows-gnu cargo test - if %target%==x86_64-pc-windows-msvc cargo test + - bootimage test diff --git a/.travis.yml b/.travis.yml index 8819d85b..4308d582 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,18 @@ branches: cache: directories: - $HOME/.cargo + - $HOME/Library/Caches/Homebrew + +addons: + apt: + packages: + - qemu-system-x86 + homebrew: + packages: + - qemu + +install: + - if [ $TRAVIS_OS_NAME = windows ]; then choco install qemu; export PATH="/c/Program Files/qemu:$PATH"; fi before_script: - rustup component add rust-src @@ -36,4 +48,5 @@ before_script: script: - bootimage build - cargo test + - bootimage test - cargo cache --autoclean From db4fd1ce1d0b905615aba45d50aaea854eef2569 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 27 Jan 2019 16:13:22 +0100 Subject: [PATCH 5/5] Rename z_post_* braches to post-* --- .appveyor.yml | 2 +- .travis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index cd9de0e3..e46b9d6b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -3,7 +3,7 @@ branches: - staging - trying - master - - /z_post_*/ + - /post-.*/ # Appveyor configuration template for Rust using rustup for Rust installation # https://github.com/starkat99/appveyor-rust diff --git a/.travis.yml b/.travis.yml index 7b23b61e..09f8f021 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ branches: # Build pull requests. - master # Build post braches - - /^z_post_.*$/ + - /^post-.*$/ cache: directories: