|
| 1 | +trigger: |
| 2 | + branches: |
| 3 | + include: ['master'] |
| 4 | + tags: |
| 5 | + include: ['v*'] |
| 6 | +pr: |
| 7 | + branches: |
| 8 | + include: |
| 9 | + - master |
| 10 | + paths: |
| 11 | + exclude: |
| 12 | + - "*.md" |
| 13 | + - "docs/*" |
| 14 | + - "LICENSE-*" |
1 | 15 | schedules:
|
2 | 16 | - cron: "6 6 6 * *"
|
3 | 17 | displayName: Monthly Build
|
4 | 18 | branches:
|
5 | 19 | include:
|
6 | 20 | - master
|
| 21 | +variables: |
| 22 | + minrust: 1.44.0 |
| 23 | + codecov_token: $(CODECOV_TOKEN_SECRET) |
| 24 | + windows_vm: vs2017-win2016 |
| 25 | + mac_vm: macos-10.14 |
| 26 | + linux_vm: ubuntu-16.04 |
7 | 27 |
|
8 |
| -jobs: |
9 |
| -- template: default.yml@templates |
10 |
| - parameters: |
11 |
| - minrust: 1.34.0 |
12 |
| - codecov_token: $(CODECOV_TOKEN_SECRET) |
13 |
| -- job: "Committed" |
14 |
| - displayName: Lint History |
15 |
| - pool: |
16 |
| - vmImage: 'ubuntu-16.04' |
17 |
| - steps: |
18 |
| - - checkout: self |
19 |
| - - template: v1/azdo-step.yml@gh-install |
20 |
| - parameters: |
21 |
| - git: crate-ci/committed |
22 |
| - target: 'x86_64-unknown-linux-gnu' |
23 |
| - to: $(Build.StagingDirectory)/tools |
24 |
| - - script: | |
25 |
| - echo "This project uses Conventional style, see https://www.conventionalcommits.org" |
26 |
| - $(Build.StagingDirectory)/tools/committed HEAD~..HEAD^2 --no-merge-commit -vv |
27 |
| - displayName: Committed |
28 |
| - condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) |
| 28 | +stages: |
| 29 | +- stage: check |
| 30 | + displayName: Compilation Check |
| 31 | + jobs: |
| 32 | + - job: cargo_check |
| 33 | + displayName: cargo check |
| 34 | + pool: |
| 35 | + vmImage: ${{ variables.linux_vm }} |
| 36 | + steps: |
| 37 | + - template: install-rust.yml@templates |
| 38 | + parameters: |
| 39 | + rust: stable |
| 40 | + - script: cargo check --workspace --all-targets |
| 41 | + displayName: Default features |
| 42 | + - script: cargo check --workspace --all-targets --no-default-features |
| 43 | + displayName: No-default features |
| 44 | + - script: cargo check --workspace --all-targets --all-features |
| 45 | + displayName: All features |
| 46 | +- stage: test |
| 47 | + displayName: Test |
| 48 | + jobs: |
| 49 | + - job: test |
| 50 | + displayName: Test |
| 51 | + strategy: |
| 52 | + matrix: |
| 53 | + windows: |
| 54 | + imageName: ${{ variables.windows_vm }} |
| 55 | + target: 'x86_64-pc-windows-msvc' |
| 56 | + channel: stable |
| 57 | + mac: |
| 58 | + imageName: ${{ variables.mac_vm }} |
| 59 | + target: 'x86_64-apple-darwin' |
| 60 | + channel: stable |
| 61 | + linux: |
| 62 | + imageName: ${{ variables.linux_vm }} |
| 63 | + target: 'x86_64-unknown-linux-gnu' |
| 64 | + channel: stable |
| 65 | + # Check for upcoming platform-specific compiler breakages |
| 66 | + windows_beta: |
| 67 | + imageName: ${{ variables.windows_vm }} |
| 68 | + target: 'x86_64-pc-windows-msvc' |
| 69 | + channel: beta |
| 70 | + mac_beta: |
| 71 | + imageName: ${{ variables.mac_vm }} |
| 72 | + target: 'x86_64-apple-darwin' |
| 73 | + channel: beta |
| 74 | + linux_beta: |
| 75 | + imageName: ${{ variables.linux_vm }} |
| 76 | + target: 'x86_64-unknown-linux-gnu' |
| 77 | + channel: beta |
| 78 | + # Check for compiler breakages |
| 79 | + linux_nightly: |
| 80 | + imageName: ${{ variables.linux_vm }} |
| 81 | + target: 'x86_64-unknown-linux-gnu' |
| 82 | + channel: nightly |
| 83 | + continueOnError: $[ne(variables.rust, 'stable')] |
| 84 | + pool: |
| 85 | + vmImage: $(imageName) |
| 86 | + steps: |
| 87 | + - template: install-rust.yml@templates |
| 88 | + parameters: |
| 89 | + rust: $(channel) |
| 90 | + targets: ["$(TARGET)"] |
| 91 | + - script: cargo test --target $(TARGET) --workspace |
| 92 | + displayName: cargo test |
| 93 | + - script: cargo doc --target $(TARGET) --workspace --no-deps |
| 94 | + displayName: cargo doc |
| 95 | + - job: msrv |
| 96 | + displayName: "${{ format('Minimum supported Rust version: {0}', variables.minrust) }}" |
| 97 | + dependsOn: [] |
| 98 | + pool: |
| 99 | + vmImage: ${{ variables.linux_vm }} |
| 100 | + steps: |
| 101 | + - template: install-rust.yml@templates |
| 102 | + parameters: |
| 103 | + rust: ${{ variables.minrust }} |
| 104 | + - script: cargo check --all --bins --examples --tests |
| 105 | + displayName: cargo check |
| 106 | +- stage: style |
| 107 | + displayName: Style checks |
| 108 | + dependsOn: [] |
| 109 | + jobs: |
| 110 | + - job: "Committed" |
| 111 | + displayName: Linting commit history |
| 112 | + pool: |
| 113 | + vmImage: ${{ variables.linux_vm }} |
| 114 | + steps: |
| 115 | + - checkout: self |
| 116 | + - template: v1/azdo-step.yml@gh-install |
| 117 | + parameters: |
| 118 | + git: crate-ci/committed |
| 119 | + target: 'x86_64-unknown-linux-gnu' |
| 120 | + to: $(Build.StagingDirectory)/tools |
| 121 | + - script: | |
| 122 | + echo "Linting commits:" |
| 123 | + git log --graph --oneline HEAD~..HEAD^2 |
| 124 | + echo "Against 'committed.toml':" |
| 125 | + $(Build.StagingDirectory)/tools/committed --dump-config - |
| 126 | + echo "" |
| 127 | + echo "If this fails, don't sweat it. We're trying to encourage clear communication and not hinder contributions." |
| 128 | + echo "If it is a reasonable issue and you lack time or feel uncomfortable fixing it yourself," |
| 129 | + echo "let us know and we can mentor or fix it." |
| 130 | + $(Build.StagingDirectory)/tools/committed HEAD~..HEAD^2 --no-merge-commit -vv |
| 131 | + displayName: Lint commit history |
| 132 | + condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) |
| 133 | + - job: style |
| 134 | + displayName: Style checking |
| 135 | + pool: |
| 136 | + vmImage: ${{ variables.linux_vm }} |
| 137 | + steps: |
| 138 | + - template: install-rust.yml@templates |
| 139 | + parameters: |
| 140 | + rust: stable |
| 141 | + components: |
| 142 | + - rustfmt |
| 143 | + - script: cargo fmt --all -- --check |
| 144 | + displayName: rustfmt |
| 145 | + - job: lint |
| 146 | + displayName: Linting |
| 147 | + strategy: |
| 148 | + matrix: |
| 149 | + current: |
| 150 | + channel: ${{ variables.minrust }} |
| 151 | + next: |
| 152 | + channel: stable |
| 153 | + continueOnError: $[eq(variables.channel, 'stable')] |
| 154 | + pool: |
| 155 | + vmImage: ${{ variables.linux_vm }} |
| 156 | + steps: |
| 157 | + - template: install-rust.yml@templates |
| 158 | + parameters: |
| 159 | + rust: $(channel) |
| 160 | + components: |
| 161 | + - clippy |
| 162 | + - script: cargo check --workspace --all-targets --all-features |
| 163 | + displayName: Warnings |
| 164 | + env: |
| 165 | + RUSTFLAGS: "-D warnings" |
| 166 | + - script: cargo clippy --workspace --all-features --all-targets -- -D warnings |
| 167 | + displayName: clippy |
| 168 | +- ${{ if ne('', variables.codecov_token) }}: |
| 169 | + - stage: coverage |
| 170 | + displayName: Code coverage |
| 171 | + dependsOn: test |
| 172 | + jobs: |
| 173 | + - template: coverage.yml@templates |
| 174 | + parameters: |
| 175 | + token: ${{ variables.codecov_token }} |
29 | 176 |
|
30 | 177 | resources:
|
31 | 178 | repositories:
|
|
0 commit comments