1
1
jobs :
2
2
# Check formatting
3
3
- job : ${{ parameters.name }}
4
+ variables :
5
+ cfgRelease : ' '
6
+ cfgReleaseChannel : ${{ parameters.rust }}
4
7
displayName : Run tests on
5
8
strategy :
6
9
matrix :
@@ -19,11 +22,39 @@ jobs:
19
22
- script : |
20
23
rustup component add rust-src rust-analysis rustc-dev llvm-tools-preview
21
24
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')
22
37
- ${{ 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
24
46
displayName: Run tests - ${{ crate.key }}
25
47
workingDirectory: $(Build.SourcesDirectory)/${{ crate.key }}
48
+ condition: eq(variables['Agent.OS'], 'Windows_NT')
26
49
- ${{ 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 }}
28
58
displayName: Run tests - ${{ crate.key }} - ${{ extra.test_name }}
29
59
workingDirectory: $(Build.SourcesDirectory)/${{ crate.key }}
60
+ condition: eq(variables['Agent.OS'], 'Windows_NT')
0 commit comments