Skip to content

Commit caf15f6

Browse files
committed
update trust CI template
1 parent 9ea12ba commit caf15f6

File tree

4 files changed

+115
-47
lines changed

4 files changed

+115
-47
lines changed

.appveyor.yml

+45-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,51 @@
1-
# Based on https://github.com/retep998/winapi-rs/blob/0.3.3/appveyor.yml
1+
# Based on the "trust" template v0.1.2
2+
# https://github.com/japaric/trust/tree/v0.1.2
23

34
environment:
5+
global:
6+
RUST_VERSION: stable
47
matrix:
5-
- TARGET: nightly-x86_64-pc-windows-msvc
6-
- TARGET: nightly-i686-pc-windows-msvc
7-
- TARGET: nightly-x86_64-pc-windows-gnu
8-
- TARGET: nightly-i686-pc-windows-gnu
9-
- TARGET: 1.13.0-x86_64-pc-windows-msvc
8+
# MinGW
9+
- TARGET: i686-pc-windows-gnu
10+
- TARGET: x86_64-pc-windows-gnu
11+
12+
# MSVC
13+
- TARGET: i686-pc-windows-msvc
14+
- TARGET: x86_64-pc-windows-msvc
15+
16+
# rustc minimum version.
17+
- TARGET: x86_64-pc-windows-msvc
18+
RUST_VERSION: 1.13.0
19+
1020
install:
11-
- ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-${env:TARGET}.exe" -FileName "rust-install.exe"
12-
- ps: .\rust-install.exe /VERYSILENT /NORESTART /DIR="C:\rust" | Out-Null
13-
- ps: $env:PATH="$env:PATH;C:\rust\bin"
14-
- rustc -vV
15-
- cargo -vV
21+
- ps: >-
22+
If ($Env:TARGET -eq 'x86_64-pc-windows-gnu') {
23+
$Env:PATH += ';C:\msys64\mingw64\bin'
24+
} ElseIf ($Env:TARGET -eq 'i686-pc-windows-gnu') {
25+
$Env:PATH += ';C:\msys64\mingw32\bin'
26+
}
27+
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
28+
- rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION%
29+
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
30+
- rustc -Vv
31+
- cargo -V
32+
1633
build_script:
17-
- cargo build
34+
- cargo build --target %TARGET% &&
35+
cargo build --target %TARGET% --release
36+
1837
test_script:
19-
- cargo test
38+
- cargo test --target %TARGET% &&
39+
cargo test --target %TARGET% --release
40+
41+
cache:
42+
- C:\Users\appveyor\.cargo\registry
43+
- target
44+
45+
branches:
46+
only:
47+
- master
48+
49+
notifications:
50+
- provider: Email
51+
on_build_success: false

.travis.yml

+45-24
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,51 @@
1-
# Based on the "trust" template v0.1.1
2-
# https://github.com/japaric/trust/tree/v0.1.1
1+
# Based on the "trust" template v0.1.2
2+
# https://github.com/japaric/trust/tree/v0.1.2
33

44
dist: trusty
55
language: rust
66
services: docker
77
sudo: required
88

9-
rust: nightly
10-
env: TARGET=x86_64-unknown-linux-gnu
9+
env:
10+
global:
11+
- CRATE_NAME=memmap
1112

1213
matrix:
13-
# TODO These are all the build jobs. Adjust as necessary. Comment out what you
14-
# don't need
1514
include:
15+
# Android
16+
- env: TARGET=aarch64-linux-android DISABLE_TESTS=1
17+
- env: TARGET=arm-linux-androideabi DISABLE_TESTS=1
18+
- env: TARGET=armv7-linux-androideabi DISABLE_TESTS=1
19+
- env: TARGET=i686-linux-android DISABLE_TESTS=1
20+
- env: TARGET=x86_64-linux-android DISABLE_TESTS=1
21+
22+
# iOS
23+
- env: TARGET=aarch64-apple-ios DISABLE_TESTS=1
24+
os: osx
25+
- env: TARGET=armv7-apple-ios DISABLE_TESTS=1
26+
os: osx
27+
- env: TARGET=armv7s-apple-ios DISABLE_TESTS=1
28+
os: osx
29+
- env: TARGET=i386-apple-ios DISABLE_TESTS=1
30+
os: osx
31+
- env: TARGET=x86_64-apple-ios DISABLE_TESTS=1
32+
os: osx
33+
1634
# Linux
35+
- env: TARGET=aarch64-unknown-linux-gnu
36+
- env: TARGET=arm-unknown-linux-gnueabi
37+
- env: TARGET=armv7-unknown-linux-gnueabihf
1738
- env: TARGET=i686-unknown-linux-gnu
1839
- env: TARGET=i686-unknown-linux-musl
19-
# - env: TARGET=x86_64-unknown-linux-gnu # this is the default job
40+
- env: TARGET=mips-unknown-linux-gnu
41+
- env: TARGET=mips64-unknown-linux-gnuabi64
42+
- env: TARGET=mips64el-unknown-linux-gnuabi64
43+
- env: TARGET=mipsel-unknown-linux-gnu
44+
- env: TARGET=powerpc-unknown-linux-gnu
45+
- env: TARGET=powerpc64-unknown-linux-gnu
46+
- env: TARGET=powerpc64le-unknown-linux-gnu
47+
- env: TARGET=s390x-unknown-linux-gnu DISABLE_TESTS=1
48+
- env: TARGET=x86_64-unknown-linux-gnu
2049
- env: TARGET=x86_64-unknown-linux-musl
2150

2251
# OSX
@@ -30,25 +59,13 @@ matrix:
3059
- env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1
3160
- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1
3261

33-
# Other architectures
34-
- env: TARGET=aarch64-unknown-linux-gnu
35-
- env: TARGET=armv7-unknown-linux-gnueabihf
36-
- env: TARGET=mips-unknown-linux-gnu
37-
- env: TARGET=mips64-unknown-linux-gnuabi64
38-
- env: TARGET=mips64el-unknown-linux-gnuabi64
39-
- env: TARGET=mipsel-unknown-linux-gnu
40-
- env: TARGET=powerpc-unknown-linux-gnu
41-
- env: TARGET=powerpc64-unknown-linux-gnu
42-
- env: TARGET=powerpc64le-unknown-linux-gnu
43-
- env: TARGET=s390x-unknown-linux-gnu DISABLE_TESTS=1
44-
45-
# Testing other channels
46-
- env: TARGET=x86_64-unknown-linux-gnu
62+
# rustc minimum version.
63+
- env: TARGET=x86_64-unknown-linux-gnu DISABLE_TESTS=1
4764
rust: 1.13.0
48-
- env: TARGET=x86_64-unknown-linux-gnu
49-
rust: stable
5065

51-
before_install: set -e
66+
before_install:
67+
- set -e
68+
- rustup self update
5269

5370
install:
5471
- sh ci/install.sh
@@ -64,6 +81,10 @@ before_cache:
6481
# Travis can't cache files that are not readable by "others"
6582
- chmod -R a+r $HOME/.cargo
6683

84+
branches:
85+
only:
86+
- master
87+
6788
notifications:
6889
email:
6990
on_success: never

ci/install.sh

+22-6
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,41 @@
11
set -ex
22

33
main() {
4-
curl https://sh.rustup.rs -sSf | \
5-
sh -s -- -y --default-toolchain $TRAVIS_RUST_VERSION
6-
74
local target=
85
if [ $TRAVIS_OS_NAME = linux ]; then
9-
target=x86_64-unknown-linux-gnu
6+
target=x86_64-unknown-linux-musl
107
sort=sort
118
else
129
target=x86_64-apple-darwin
1310
sort=gsort # for `sort --sort-version`, from brew's coreutils.
1411
fi
1512

13+
# Builds for iOS are done on OSX, but require the specific target to be
14+
# installed.
15+
case $TARGET in
16+
aarch64-apple-ios)
17+
rustup target install aarch64-apple-ios
18+
;;
19+
armv7-apple-ios)
20+
rustup target install armv7-apple-ios
21+
;;
22+
armv7s-apple-ios)
23+
rustup target install armv7s-apple-ios
24+
;;
25+
i386-apple-ios)
26+
rustup target install i386-apple-ios
27+
;;
28+
x86_64-apple-ios)
29+
rustup target install x86_64-apple-ios
30+
;;
31+
esac
32+
1633
# This fetches latest stable release
1734
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
1835
| cut -d/ -f3 \
19-
| grep -E '^v[0-9.]+$' \
36+
| grep -E '^v[0.1.0-9.]+$' \
2037
| $sort --version-sort \
2138
| tail -n1)
22-
echo cross version: $tag
2339
curl -LSfs https://japaric.github.io/trust/install.sh | \
2440
sh -s -- \
2541
--force \

ci/script.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
set -ex
44

5-
# TODO This is the "test phase", tweak it as you see fit
65
main() {
76
cross build --target $TARGET
87
cross build --target $TARGET --release
98

109
if [ ! -z $DISABLE_TESTS ]; then
1110
return
12-
else
13-
cross test --target $TARGET
14-
cross test --target $TARGET --release
1511
fi
12+
13+
cross test --target $TARGET
14+
cross test --target $TARGET --release
1615
}
1716

1817
# we don't run the "test phase" when doing deploys

0 commit comments

Comments
 (0)