-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set up CI with Azure Pipelines #7139
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
trigger: | ||
branches: | ||
include: | ||
- '*' | ||
exclude: | ||
- master | ||
pr: | ||
- master | ||
|
||
jobs: | ||
- job: Linux | ||
pool: | ||
vmImage: ubuntu-16.04 | ||
steps: | ||
- template: ci/azure-test-all.yml | ||
strategy: | ||
matrix: | ||
stable: | ||
TOOLCHAIN: stable | ||
beta: | ||
TOOLCHAIN: beta | ||
nightly: | ||
TOOLCHAIN: nightly | ||
variables: | ||
OTHER_TARGET: i686-unknown-linux-gnu | ||
|
||
- job: macOS | ||
pool: | ||
vmImage: macos-10.13 | ||
steps: | ||
- template: ci/azure-test-all.yml | ||
variables: | ||
TOOLCHAIN: stable | ||
OTHER_TARGET: i686-apple-darwin | ||
|
||
- job: Windows | ||
pool: | ||
vmImage: windows-2019 | ||
steps: | ||
- template: ci/azure-test-all.yml | ||
strategy: | ||
matrix: | ||
x86_64-msvc: | ||
TOOLCHAIN: stable-x86_64-pc-windows-msvc | ||
OTHER_TARGET: i686-pc-windows-msvc | ||
- job: rustfmt | ||
pool: | ||
vmImage: ubuntu-16.04 | ||
steps: | ||
- template: ci/azure-install-rust.yml | ||
- bash: rustup component add rustfmt | ||
displayName: "Install rustfmt" | ||
- bash: cargo fmt --all -- --check | ||
displayName: "Check rustfmt (cargo)" | ||
- bash: cd crates/cargo-test-macro && cargo fmt --all -- --check | ||
displayName: "Check rustfmt (cargo-test-macro)" | ||
- bash: cd crates/crates-io && cargo fmt --all -- --check | ||
displayName: "Check rustfmt (crates-io)" | ||
- bash: cd crates/resolver-tests && cargo fmt --all -- --check | ||
displayName: "Check rustfmt (resolver-tests)" | ||
variables: | ||
TOOLCHAIN: stable | ||
|
||
- job: resolver | ||
pool: | ||
vmImage: ubuntu-16.04 | ||
steps: | ||
- template: ci/azure-install-rust.yml | ||
- bash: cargo test --manifest-path crates/resolver-tests/Cargo.toml | ||
displayName: "Resolver tests" | ||
variables: | ||
TOOLCHAIN: stable | ||
|
||
- job: docs | ||
pool: | ||
vmImage: ubuntu-16.04 | ||
steps: | ||
- template: ci/azure-install-rust.yml | ||
- bash: | | ||
set -e | ||
mkdir mdbook | ||
curl -Lf https://github.com/rust-lang-nursery/mdBook/releases/download/v0.3.1/mdbook-v0.3.1-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook | ||
echo "##vso[task.prependpath]`pwd`/mdbook" | ||
displayName: "Install mdbook" | ||
- bash: cargo doc --no-deps | ||
displayName: "Build documentation" | ||
- bash: cd src/doc && mdbook build --dest-dir ../../target/doc | ||
displayName: "Build mdbook documentation" | ||
variables: | ||
TOOLCHAIN: stable | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
steps: | ||
- bash: | | ||
set -e | ||
if command -v rustup; then | ||
echo `command -v rustup` `rustup -V` already installed | ||
rustup self update | ||
elif [ "$AGENT_OS" = "Windows_NT" ]; then | ||
curl -sSf -o rustup-init.exe https://win.rustup.rs | ||
rustup-init.exe -y --default-toolchain $TOOLCHAIN | ||
echo "##vso[task.prependpath]$USERPROFILE/.cargo/bin" | ||
else | ||
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $TOOLCHAIN | ||
echo "##vso[task.prependpath]$HOME/.cargo/bin" | ||
fi | ||
displayName: Install rustup | ||
|
||
- bash: | | ||
set -e | ||
rustup update $TOOLCHAIN | ||
rustup default $TOOLCHAIN | ||
displayName: Install rust | ||
|
||
- bash: | | ||
set -ex | ||
rustup -V | ||
rustc -Vv | ||
cargo -V | ||
displayName: Query rust and cargo versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
steps: | ||
- checkout: self | ||
fetchDepth: 1 | ||
|
||
- template: azure-install-rust.yml | ||
|
||
- bash: rustup target add $OTHER_TARGET | ||
displayName: "Install cross-compile target" | ||
|
||
- bash: sudo apt install gcc-multilib | ||
displayName: "Install gcc-multilib (linux)" | ||
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) | ||
|
||
# Some tests rely on a clippy command to run, so let's try to install clippy to | ||
# we can be sure to run those tests. | ||
- bash: rustup component add clippy || echo "clippy not available" | ||
displayName: "Install clippy (maybe)" | ||
|
||
# Deny warnings on CI to avoid warnings getting into the codebase, and note the | ||
# `force-system-lib-on-osx` which is intended to fix compile issues on OSX where | ||
# compiling curl from source on OSX yields linker errors on Azure. | ||
# | ||
# Note that the curl issue is traced back to alexcrichton/curl-rust#279 where it | ||
# looks like the OSX version we're actually running on is such that a symbol is | ||
# emitted that's never worked. For now force the system library to be used to | ||
# fix the link errors. | ||
- bash: cargo test --features 'deny-warnings curl/force-system-lib-on-osx' | ||
displayName: "cargo test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some investigation and my results are at alexcrichton/curl-rust#279.
The reason it works on Travis is because it is using the real system curl, with the HTTP2 feature built-in. It looks like azure installs their own curl (
/usr/local/opt/curl
) which does not have HTTP2 enabled which fails this test, which causes it to be built statically, which hits the bug listed above.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! I've updated the comment here to reflect the results of what you found.
FWIW I think that's why things worked by default on Travis but IIRC the curl-rust crate still tested compiling libcurl statically and it ended up working out, but it may have used different surface areas than Cargo itself.