From c3994bf57b5d2f1f973b0e4e37bc385695aa4ed2 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Thu, 27 Jun 2019 11:05:54 +0200 Subject: [PATCH] Use Travis for Win builds as well --- .travis.yml | 71 +++++++++++++++++++++++++++----------------------- README.md | 4 +-- appveyor.yml | 13 --------- format-all.bat | 17 ------------ test-all.bat | 46 -------------------------------- 5 files changed, 40 insertions(+), 111 deletions(-) delete mode 100644 appveyor.yml delete mode 100644 format-all.bat delete mode 100644 test-all.bat diff --git a/.travis.yml b/.travis.yml index 12738c8995..d00cc4bcb1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,43 +1,50 @@ # Travis CI script borrows heavily from CraneStation/wasmtime project. os: - - linux - - osx + - linux + - osx + - windows language: rust rust: - 1.36.0 + - stable - beta - nightly matrix: - allow_failures: - # We try to be compatible with beta and nightly, but they occasionally - # fail, so we don't allow them to hold up people using stable. - - rust: beta - - rust: nightly - # Similarly, we don't need to hold up people using stable while we wait - # for the results which may fail. - fast_finish: true + allow_failures: + # We try to be compatible with beta and nightly, but they occasionally + # fail, so we don't allow them to hold up people using stable. + - rust: beta + - rust: nightly + # Similarly, we don't need to hold up people using stable while we wait + # for the results which may fail. + fast_finish: true dist: xenial sudo: false -branches: - only: - - master -before_script: - # If an old version of rustfmt from cargo is already installed, uninstall - # it, since it can prevent the installation of the new version from rustup. - - cargo uninstall rustfmt || true - - cargo install --list - # If we're testing beta or nightly, we still need to install the stable - # toolchain so that we can run the stable version of rustfmt. - - rustup toolchain install stable - # Install the stable version of rustfmt. - - rustup component add --toolchain=stable rustfmt-preview - - rustup component list --toolchain=stable - - rustup show - - rustfmt +stable --version || echo fail - # Sometimes the component isn't actually ready after being installed, and - # rustup update makes it ready. - - rustup update - - rustfmt +stable --version -script: ./test-all.sh +# Caching done according to pointers found in +# https://levans.fr/rust_travis_cache.html cache: - cargo: true + directories: + - $HOME/.cargo +before_cache: + - rm -rf /home/travis/.cargo/registry +before_install: + - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then choco install python3; fi + - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export PATH="/c/Python37:/c/Python37/Scripts:$PATH"; fi +before_script: + # If an old version of rustfmt from cargo is already installed, uninstall + # it, since it can prevent the installation of the new version from rustup. + - cargo uninstall rustfmt || true + - cargo install --list + # If we're testing beta or nightly, we still need to install the stable + # toolchain so that we can run the stable version of rustfmt. + - rustup toolchain install stable + # Install the stable version of rustfmt. + - rustup component add --toolchain=stable rustfmt-preview + - rustup component list --toolchain=stable + - rustup show + - rustfmt +stable --version || echo fail + # Sometimes the component isn't actually ready after being installed, and + # rustup update makes it ready. + - rustup update + - rustfmt +stable --version +script: ./test-all.sh diff --git a/README.md b/README.md index c33010e11f..1653e93fee 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ # wasi-common -[![travis-build-status]][travis] [![appveyor-build-status]][appveyor] [![rustc-1.36]][rustc] +[![travis-build-status]][travis] [![rustc-1.36]][rustc] [travis-build-status]: https://travis-ci.org/CraneStation/wasi-common.svg?branch=master [travis]: https://travis-ci.org/CraneStation/wasi-common -[appveyor-build-status]: https://ci.appveyor.com/api/projects/status/github/cranestation/wasi-common?svg=true -[appveyor]: https://ci.appveyor.com/project/cranestation/wasi-common [rustc-1.36]: https://img.shields.io/badge/rustc-1.36+-lightgray.svg [rustc]: https://blog.rust-lang.org/2019/07/04/Rust-1.36.0.html [Wasmtime]: https://github.com/CraneStation/wasmtime diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index b39a657009..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,13 +0,0 @@ -os: Visual Studio 2017 -environment: - matrix: - - TARGET: x86_64-pc-windows-msvc -install: - - appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe - - rustup-init.exe -yv --default-host %target% - - set PATH=%PATH%;%USERPROFILE%\.cargo\bin - - rustc -vV - - cargo -vV - - rustup component add rustfmt -build: false -test_script: test-all.bat diff --git a/format-all.bat b/format-all.bat deleted file mode 100644 index fc5d0e15cd..0000000000 --- a/format-all.bat +++ /dev/null @@ -1,17 +0,0 @@ -@echo off -setlocal - -@rem Format all sources using rustfmt. -@rem This script is an adaption of the shell version -@rem 'format-all.sh'. - -for /F "delims=" %%i in ("%%~f0") do set dirname=%%~dpi -cd %dirname% - -@REM Make sure we can find rustfmt -set PATH=%PATH%;%USERPROFILE%\.cargo\bin - -cmd /C cargo +stable fmt --all -- %* - -endlocal -exit /b %ERRORLEVEL% \ No newline at end of file diff --git a/test-all.bat b/test-all.bat deleted file mode 100644 index 3fc8ca8374..0000000000 --- a/test-all.bat +++ /dev/null @@ -1,46 +0,0 @@ -@echo off -setlocal - -@rem This is the top-level test script. -@rem It is an adaption of the shell script "test-all.sh". -@rem - Check code formatting. -@rem - Make a debug build. -@rem - Make a release build. -@rem - Run unit tests for all Rust crates -@rem - Build API documentation. -@rem All tests run by this script should be passing at all times. - -for /F "delims=" %%i in ("%%~f0") do set dirname=%%~dpi -cd %dirname% - -call :banner Rust formatting -cmd /c "%dirname%format-all.bat --check" -if %errorlevel% neq 0 ( - echo Formatting diffs detected! Run "cargo fmt --all" to correct. - goto error -) - -call :banner Release build -cmd /c cargo build --release || goto error - -call :banner Debug build -cmd /c cargo build || goto error - -call :banner Rust unit and integration tests -set RUST_BACKTRACE=1 -cmd /c cargo test --all || goto error - -call :banner Rust documentation: %dirname%target\doc\wasi-common\index.html -cmd /c cargo doc || goto error - -call :banner OK - -endlocal -exit /b %ERRORLEVEL% - -:banner -echo ===== %* ===== -exit /b 0 - -:error -exit /b 1