-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
runpublishvrscreenshot.yml
75 lines (67 loc) · 2.47 KB
/
runpublishvrscreenshot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
parameters:
- name: fluentVersion
type: string
default: v8
- name: vrTestPackageName
type: string
default: '@fluentui/vr-tests'
- name: vrTestPackagePath
type: string
default: 'apps/vr-tests'
- name: shouldBuildstorybookaddon
type: boolean
default: false
- name: shouldBuildNorthstar
type: boolean
default: false
steps:
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn (install packages)
- script: |
isPR=${{lower(eq(variables['Build.Reason'], 'PullRequest'))}}
echo $isPR
if [[ $isPR == true ]]; then
packageAffected=$(yarn --silent check:affected-package --packages ${{ parameters.vrTestPackageName }} --pr=true)
if [[ $packageAffected == false ]]; then
echo "In PR pipeline but NOT affecting test package. Skipping test run"
echo "##vso[task.setvariable variable=vrTestSkip;]yes"
else
echo "In PR pipeline and affecting test package. NOT Skipping test run"
echo "##vso[task.setvariable variable=vrTestSkip;]no"
fi
else
echo "Not in PR pipeline. NOT Skipping test run"
echo "##vso[task.setvariable variable=vrTestSkip;]no"
fi
displayName: Check if vrTests should be skipped
- ${{ if eq(parameters.shouldBuildstorybookaddon, 'true') }}:
- script: |
yarn build --to @fluentui/react-storybook-addon
displayName: Build react-storybook-addon
condition: eq(variables['vrTestSkip'], 'no')
- ${{ if eq(parameters.shouldBuildNorthstar, 'true') }}:
- script: |
yarn build --to @fluentui/docs
displayName: Build react-northstar
condition: eq(variables['vrTestSkip'], 'no')
- script: |
yarn workspace ${{ parameters.vrTestPackageName }} vr:build
displayName: Build VR tests components package
condition: eq(variables['vrTestSkip'], 'no')
- script: |
yarn workspace ${{ parameters.vrTestPackageName }} vr:test --verbose
displayName: 'Run VR tests'
condition: eq(variables['vrTestSkip'], 'no')
- script: |
mkdir -p screenshots
cp -rf ${{ parameters.vrTestPackagePath }}/dist/screenshots/*.png screenshots/
displayName: Collate Artifacts
condition: eq(variables['vrTestSkip'], 'no')
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: 'screenshots'
ArtifactName: 'vrscreenshot${{ parameters.fluentVersion }}'
publishLocation: 'Container'
condition: eq(variables['vrTestSkip'], 'no')