-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
.travis.yml
79 lines (67 loc) · 2.51 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
language: rust
rust: [ stable ]
cache: { cargo: true }
env: [ CARGO_TERM_COLOR=always ]
jobs:
include:
- stage: Test & Setup
name: cargo fmt
env: CACHE_BUCKET=fmt
install: rustup component add rustfmt
script: cargo fmt -- --check
- name: cargo check
env: CACHE_BUCKET=check
script: ./scripts/check.sh
- name: clippy
env: CACHE_BUCKET=clippy
install: rustup component add clippy
script: cargo clippy --all-targets --all-features -- -A clippy::redundant_field_names
- name: e2e tests
env: CACHE_BUCKET=test
install: source scripts/ci-test-deps.sh
script: ./test/tests.sh
# Prepare docker build environments
- name: prepare build env
cache: &build_cache
cargo: false
directories: [ $HOME/docker-cache ]
# Docker builder images are cached for the next jobs below, but nothing is cached across different builds.
# This is done as a security measure, so that the cache couldn't be poisoned to inject malicious code into future builds.
script: |
rm -rf ~/docker-cache
mkdir -p ~/docker-cache
docker build -t bwt-builder -f scripts/builder.Dockerfile .
docker build -t bwt-builder-osx -f scripts/builder-osx.Dockerfile .
docker save bwt-builder | gzip -2 > ~/docker-cache/bwt-builder.tar.gz
docker save bwt-builder-osx | gzip -2 > ~/docker-cache/bwt-builder-osx.tar.gz
- &build
stage: Reproducible builds
cache: *build_cache
script:
- >
: ${IMAGE:=bwt-builder} &&
echo -e tr''avis_fo''ld:start:build\\nBuilding... &&
gzip -d < ~/docker-cache/$IMAGE.tar.gz | docker load &&
docker run -e TARGETS -u `id -u` -v `pwd`:/usr/src/bwt -v ${CARGO_HOME:-$HOME/.cargo}:/usr/local/cargo $IMAGE &&
echo tr''avis_fol''d:end:build
- >
rm -rf dist/*/ &&
echo '-----BEGIN SHA256SUM-----' &&
(cd dist && sha256sum * | sort) &&
echo
# XXX if: branch in (master, dev, latest) OR tag IS present
name: linux
before_script: export TARGETS=x86_64-linux
# avoid using `env` so the cache won't get separated
- <<: *build
name: windows
before_script: export TARGETS=x86_64-windows
- <<: *build
name: osx
before_script: export TARGETS=x86_64-osx IMAGE=bwt-builder-osx
- <<: *build
name: arm32v7
before_script: export TARGETS=arm32v7-linux
- <<: *build
name: arm64v8
before_script: export TARGETS=arm64v8-linux