Skip to content

Commit

Permalink
Build docs in parallel, only gate their publication on successful exe…
Browse files Browse the repository at this point in the history
…cution of all tests.
  • Loading branch information
dherman committed May 22, 2019
1 parent 6061a3f commit 2d3f742
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 29 deletions.
26 changes: 18 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,32 @@ jobs:
name: overrides
displayName: Extract overrides from top commit

- job: publish_docs
- job: api_docs
dependsOn:
- vars
# - nix
# - windows
displayName: Publish API Docs
displayName: Build API Docs
# Using macOS for this b/c it's substantially the fastest.
strategy:
matrix:
mac:
imageName: "macos-10.13"
steps:
- template: ci/publish-docs.yml
# FIXME: This is temporary until the publishing logic is working...
# condition: and(succeeded('nix'), succeeded('windows'), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), dependencies.vars.outputs['overrides.docs']))
condition: dependencies.vars.outputs['overrides.docs']
- template: ci/build-api-docs.yml
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), dependencies.vars.outputs['overrides.docs'])

- job: publish_docs
dependsOn:
- nix
- windows
- api_docs
displayName: Publish API Docs
strategy:
matrix:
mac:
imageName: "macos-10.13"
steps:
- template: ci/publish-api-docs.yml
condition: and(succeeded('nix'), succeeded('windows'), succeeded('api_docs'))

- job: publish_release
displayName: Publish Release artifacts
Expand Down
28 changes: 28 additions & 0 deletions ci/build-api-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
steps:
- script: |
set -e
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: Install nightly Rust for docs
- script: |
cargo doc -p progress-read --no-deps
cargo doc -p volta-fail --no-deps
cargo doc -p archive --no-deps
cargo doc --features cross-platform-docs -p volta-core --no-deps
cargo doc --features cross-platform-docs --no-deps
env:
RUSTDOCFLAGS: --document-private-items
displayName: Generate docs
- script: |
mkdir -p publish
mv target/doc publish/master
echo '<!doctype html><a href="volta">volta</a>' > publish/master/index.html
echo '<!doctype html><a href="master">master</a>' > publish/index.html
displayName: Prep docs for publication
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'api_docs'
targetPath: 'publish'
29 changes: 8 additions & 21 deletions ci/publish-docs.yml → ci/publish-api-docs.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
steps:
- script: |
set -e
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: Install nightly Rust for docs
- script: |
cargo doc -p progress-read --no-deps
cargo doc -p volta-fail --no-deps
cargo doc -p archive --no-deps
cargo doc --features cross-platform-docs -p volta-core --no-deps
cargo doc --features cross-platform-docs --no-deps
env:
RUSTDOCFLAGS: --document-private-items
displayName: Generate docs
- script: |
mkdir -p publish
mv target/doc publish/master
echo '<!doctype html><a href="volta">volta</a>' > publish/master/index.html
echo '<!doctype html><a href="master">master</a>' > publish/index.html
displayName: Prep docs for publication
displayName: Create publish directory
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'api_docs'
targetPath: ./publish
displayName: Fetch generated pages

- script: |
set -e
Expand All @@ -29,7 +16,7 @@ steps:
git config user.email 'david.herman@gmail.com'
git add .
git commit -m 'Publishing GitHub Pages [ci skip]'
displayName: Commit pages
displayName: Commit pages locally
workingDirectory: ./publish
- task: DownloadSecureFile@1
Expand Down

0 comments on commit 2d3f742

Please sign in to comment.