This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor travis: Build on minimal image (#243)
* Attempt 1 * minimal → generic * Add -y to rustup script * Remove clang * Refactor. * Remove CARGO_TARGET_DIR for now * Display versions of tools from the rust toolchain * Fix
- Loading branch information
Showing
3 changed files
with
54 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,33 @@ | ||
sudo: false | ||
language: rust | ||
# Request an environment that provides sudo (that goes with larger containers) | ||
# and a minimal language environment. | ||
sudo: true | ||
language: minimal | ||
|
||
cache: cargo | ||
|
||
branches: | ||
only: | ||
- master | ||
|
||
cache: cargo | ||
env: | ||
global: | ||
- RUST_BACKTRACE=1 | ||
matrix: | ||
- RUST_TOOLCHAIN=nightly TARGET=wasm | ||
- RUST_TOOLCHAIN=stable TARGET=native | ||
|
||
matrix: | ||
fast_finish: false | ||
include: | ||
- rust: stable | ||
before_install: | ||
# Check how much space we've got on this machine. | ||
- df -h | ||
|
||
script: | ||
- cargo test --all | ||
- cargo clean | ||
- ./init.sh | ||
- ./build.sh | ||
- if [ "$TRAVIS_PULL_REQUEST" != "true" ] && [ "$TRAVIS_BRANCH" == "master" ]; then | ||
./publish-wasm.sh; | ||
- ./ci/script.sh | ||
|
||
after_success: | ||
- if [ "$TARGET" == "wasm" ] && [ "$TRAVIS_PULL_REQUEST" != "true" ] && [ "$TRAVIS_BRANCH" == "master" ]; then | ||
./ci/publish-wasm.sh; | ||
fi | ||
|
||
after_script: | ||
# Check how much free disk space left after the build | ||
- df -h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
# Install rustup and the specified rust toolchain. | ||
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=$RUST_TOOLCHAIN -y | ||
|
||
# Load cargo environment. Specifically, put cargo into PATH. | ||
source ~/.cargo/env | ||
|
||
rustc --version | ||
rustup --version | ||
cargo --version | ||
|
||
case $TARGET in | ||
"native") | ||
sudo apt-get -y update | ||
sudo apt-get install -y cmake pkg-config libssl-dev | ||
|
||
cargo test --all | ||
;; | ||
|
||
"wasm") | ||
# Install prerequisites and build all wasm projects | ||
./init.sh | ||
./build.sh | ||
;; | ||
esac |