Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit efac425

Browse files
ci: include CFG_RELASE vars for rustc-ap crates
1 parent a740229 commit efac425

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

ci/azure-test.yml

+33-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
jobs:
22
# Check formatting
33
- job: ${{ parameters.name }}
4+
variables:
5+
cfgRelease: ''
6+
cfgReleaseChannel: ${{ parameters.rust }}
47
displayName: Run tests on
58
strategy:
69
matrix:
@@ -19,11 +22,39 @@ jobs:
1922
- script: |
2023
rustup component add rust-src rust-analysis rustc-dev llvm-tools-preview
2124
displayName: Install distributed Rust source code for Racer autocompletion
25+
- script: |
26+
CFG_RELEASE=$(rustc --version | cut -d ' ' -f 2 | cut -d '-' -f 1)
27+
echo "##vso[task.setvariable variable=cfgRelease]$CFG_RELEASE"
28+
displayName: Set CFG_RELEASE variable
29+
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
30+
- powershell: |
31+
$rustVersion = rustc --version
32+
$rustVersionParts = $rustVersion -split " " -split "-"
33+
$cfgRelease = $rustVersionParts[1]
34+
Write-Host "##vso[task.setvariable variable=cfgRelease]$cfgRelease"
35+
displayName: Set CFG_RELEASE variables
36+
condition: eq(variables['Agent.OS'], 'Windows_NT')
2237
- ${{ each crate in parameters.crates }}:
23-
- script: cargo test -v
38+
- script: CFG_RELEASE_CHANNEL=$(cfgReleaseChannel) CFG_RELEASE=$(cfgRelease) cargo test -v
39+
displayName: Run tests - ${{ crate.key }}
40+
workingDirectory: $(Build.SourcesDirectory)/${{ crate.key }}
41+
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
42+
- script: |
43+
set CFG_RELEASE_CHANNEL=$(cfgReleaseChannel)
44+
set CFG_RELEASE=$(cfgRelease)
45+
cargo test -v
2446
displayName: Run tests - ${{ crate.key }}
2547
workingDirectory: $(Build.SourcesDirectory)/${{ crate.key }}
48+
condition: eq(variables['Agent.OS'], 'Windows_NT')
2649
- ${{ each extra in crate.value }}:
27-
- script: cargo test -v ${{ extra.args }} ${{ extra.test_name }} -- ${{ extra.test_args }}
50+
- script: CFG_RELEASE_CHANNEL=$(cfgReleaseChannel) CFG_RELEASE=$(cfgRelease) cargo test -v ${{ extra.args }} ${{ extra.test_name }} -- ${{ extra.test_args }}
51+
displayName: Run tests - ${{ crate.key }} - ${{ extra.test_name }}
52+
workingDirectory: $(Build.SourcesDirectory)/${{ crate.key }}
53+
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
54+
- script: |
55+
set CFG_RELEASE_CHANNEL=$(cfgReleaseChannel)
56+
set CFG_RELEASE=$(cfgRelease)
57+
cargo test -v ${{ extra.args }} ${{ extra.test_name }} -- ${{ extra.test_args }}
2858
displayName: Run tests - ${{ crate.key }} - ${{ extra.test_name }}
2959
workingDirectory: $(Build.SourcesDirectory)/${{ crate.key }}
60+
condition: eq(variables['Agent.OS'], 'Windows_NT')

0 commit comments

Comments
 (0)