This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
80 lines (66 loc) · 2.26 KB
/
azure-pipelines.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
76
77
78
79
80
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- main
pool:
vmImage: "windows-latest"
variables:
NVDA_LOG_FILE_PATH: '$(Build.SourcesDirectory)\lib\a11y-snapshot\nvda.log'
PLAYWRIGHT_CACHE_FOLDER: '$(UserProfile)\AppData\Local\ms-playwright'
SCREEN_READER_TESTING_LIBRARY_CACHE_FOLDER: '$(UserProfile)\AppData\Local\screen-reader-testing-library'
YARN_CACHE_FOLDER: '$(Pipeline.Workspace)\.yarn'
steps:
- powershell: |
# Set empty so that publishing the artifact doesn't fail if we haven't run NVDA yet.
Set-Content -Path '${{ variables.NVDA_LOG_FILE_PATH }}' -Value ''
displayName: setup
- task: NodeTool@0
inputs:
versionSpec: "16.x"
displayName: "Install Node.js"
- task: Cache@2
inputs:
key: 'yarn-v2 | "$(Agent.OS)" | yarn.lock'
restoreKeys: |
yarn-v2 | "$(Agent.OS)"
yarn-v2
path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages
- task: Cache@2
inputs:
key: 'playwright | "$(Agent.OS)" | yarn.lock'
restoreKeys: |
playwright | "$(Agent.OS)"
path: $(PLAYWRIGHT_CACHE_FOLDER)
displayName: Cache Playwright browser binaries
- task: Cache@2
inputs:
key: 'screen-reader-testing-library | "$(Agent.OS)" | yarn.lock'
restoreKeys: |
screen-reader-testing-library | "$(Agent.OS)"
path: $(SCREEN_READER_TESTING_LIBRARY_CACHE_FOLDER)
displayName: Cache screen-reader binaries
- script: |
yarn install
displayName: "install dependencies"
- script: |
node bin/env.js
displayName: Check environment
- script: |
yarn format:check
displayName: "check code style"
- script: |
yarn lint
displayName: "check code semantics"
- powershell: |
$NVDA_BIN = "$(Build.SourcesDirectory)\node_modules\screen-reader-testing-library\bin\nvda.ps1"
$LOG_FILE_PATH = "${{ variables.NVDA_LOG_FILE_PATH }}"
& $NVDA_BIN -logFile "$LOG_FILE_PATH"
yarn a11y-snapshot --ci --runInBand
& $NVDA_BIN -quit
displayName: "test"
- publish: ${{ variables.NVDA_LOG_FILE_PATH }}
artifact: nvda.log
condition: always()