aboutsummaryrefslogtreecommitdiff
path: root/.travis.yml
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-03-25 06:54:15 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-03-25 06:54:15 +0000
commit219b1573377caafaca1dc071f8513ec8be01f199 (patch)
treebe802fa2d43032312a0b5c3d047b3565c2dc6655 /.travis.yml
parent94cf23bfc4738990e6c74424450bc40f0beb2b62 (diff)
parent022d88cf4ce786642548d05e16a5a72b4970b110 (diff)
Merge #1035
1035: Add master branch docs build and publish r=matklad a=robojumper Closes #1024. Additional setup required: * The rust-analyzer travis repo needs an [environment variable](https://docs.travis-ci.com/user/environment-variables/#defining-variables-in-repository-settings) `DOCS_TOKEN` that will be used to publish docs to the `gh-pages` branch. This is a GitHub access token with the appropriate permissions to push to this repository. Travis will keep this a secret. * In the GitHub repository settings, the GitHub pages source needs to be set to the `gh-pages` branch. This option will only appear once a branch is created with this exact name -- created either through the `deploy` step or manually. * In the GitHub repository settings, a GitHub pages theme will need to be chosen. What theme to use is unimportant, but [you must choose a theme](https://github.community/t5/GitHub-Pages/Github-Pages-are-not-published-after-following-the-documentation/m-p/18676#M1398). Docs are built as part of any rust build (on linux and windows, though all my Travis windows builds have timed out), but only published on master builds on linux. The docs badge links to `https://rust-analyzer.github.io/rust-analyzer/ra_ide_api/index.html` -- since this project is a cargo workspace, there isn't a global index page, hence just the link to an arbitrarily chosen crate. If this project had a canonical main crate with good documentation, one could link to that. All other crates are accessible through the sidebar. Co-authored-by: robojumper <[email protected]>
Diffstat (limited to '.travis.yml')
-rw-r--r--.travis.yml14
1 files changed, 14 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
index 8d10a43f0..ebff7d8b0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,12 +12,15 @@ build: &rust_build
12 - rustup component add rust-src 12 - rustup component add rust-src
13 - cargo test --no-run # let's measure compile time separately 13 - cargo test --no-run # let's measure compile time separately
14 - cargo test 14 - cargo test
15 - cargo doc --all --no-deps
15 env: 16 env:
16 - RUSTFLAGS="-D warnings", CARGO_INCREMENTAL=0 17 - RUSTFLAGS="-D warnings", CARGO_INCREMENTAL=0
17 18
18matrix: 19matrix:
19 include: 20 include:
20 - os: linux 21 - os: linux
22 before_script:
23 - DEPLOY_DOCS=1
21 <<: *rust_build 24 <<: *rust_build
22 - language: node_js 25 - language: node_js
23 node_js: node 26 node_js: node
@@ -43,3 +46,14 @@ branches:
43 - staging 46 - staging
44 - master 47 - master
45 - trying 48 - trying
49
50deploy:
51 provider: pages
52 skip-cleanup: true
53 github-token: $DOCS_TOKEN # Set in the settings page of your repository, as a secure variable
54 keep-history: true
55 local-dir: target/doc
56 branch: gh-pages
57 on:
58 branch: master
59 condition: $DEPLOY_DOCS = 1