-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy path.travis.yml
76 lines (62 loc) · 2.31 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
language: rust
rust:
- nightly
addons:
firefox: "latest"
node_js:
- "stable"
branches:
only:
# Don't auto build pull requests.
# - master
# This is where pull requests from "bors r+" are built.
- staging
# This is where pull requests from "bors try" are built.
- trying
# Greenkeeper
- /^greenkeeper/.*$/
before_install:
# Get access to origin/ branches
# https://stackoverflow.com/a/47441734/6728025
- git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
- git fetch --unshallow --tags
# cache-s3
- mkdir -p ~/.local/bin
- export CACHE_S3_VERSION="v0.1.5"
- curl -f -L https://github.com/fpco/cache-s3/releases/download/$CACHE_S3_VERSION/cache-s3-$CACHE_S3_VERSION-$TRAVIS_OS_NAME-x86_64.tar.gz | tar xz -C ~/.local/bin 'cache-s3'
- cache-s3 --version
# Test node version
- node -v
# Test Rust version
# - A daily cron job tests the latest nightly, to keep a running track record
# of which nightly versions the repo is compatible without modification.
- if [ $TRAVIS_EVENT_TYPE = "cron" ]; then echo 'nightly' > rust-toolchain; fi
- rustc -V
# Install geckodriver 0.23
- wget https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz
- mkdir geckodriver
- tar -xzf geckodriver-*.tar.gz -C geckodriver
- export PATH=$PATH:$PWD/geckodriver
before_script:
# Restore
- cache-s3 --prefix="edit-text_linux_$(cat rust-toolchain)" restore --max-size=3GiB
script:
# Run test
- which x86_64-unknown-linux-gnu-gcc || true
- if [ $TRAVIS_EVENT_TYPE = "cron" ]; then ./tools ci --update; else ./tools ci; fi
after_success:
# Delete the cargo registry, then cache resulting files
- rm -rf /home/travis/.cargo/registry
- rm -rf ./docs/book/crates
- mv target/doc ./docs/book/crates
- if [ $TRAVIS_EVENT_TYPE != "cron" ] && ! ./tools book-only-is-modified; then cache-s3 --prefix="edit-text_linux_$(cat rust-toolchain)" save -p edit-frontend/node_modules/ -p ~/.cargo -p target --max-size=3GiB; fi
# Export CNAME for gh-pages publishing
- echo "docs.edit.io" > docs/book/CNAME
deploy:
provider: pages
skip-cleanup: true
github-token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
keep-history: true
local-dir: docs/book/
on:
branch: staging