forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
49 lines (40 loc) · 1.51 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
# Learn more at: https://aka.ms/yaml
jobs:
- job: npmRunTest
pool:
vmImage: ubuntu-latest
demands: npm
timeoutInMinutes: 360
steps:
- task: NodeTool@0
displayName: Use Node 16
inputs:
versionSpec: 16.x
checkLatest: true
- script: |
npm install -g $(jq -r '.packageManager' < package.json)
pnpm --version
displayName: 'Setup pnpm'
- script: |
# If we're deleting packages, pnpm won't know what other unrelated packages
# need to be reinstalled that may now be sourced from npm instead of the
# local repo. Just pay the cost of the full install.
# HEAD^1 is the merge base (typically master) in PRs, or the previous commit in pushes.
if git diff --diff-filter=DR --name-only HEAD^1 | grep -q 'package.json'; then
pnpm install
else
pnpm install --filter . --filter '...[HEAD^1]...'
fi
displayName: 'pnpm install'
- script: |
if [[ $BUILD_REASON == "Schedule" ]]; then git config --global user.email "[email protected]" && git config --global user.name "TypeScript Bot" && pnpm run update-codeowners; fi
git checkout -- .
pnpm run test-all
displayName: 'pnpm run test-all'
- task: PublishPipelineArtifact@1
condition: eq(variables['System.debug'], 'true')
inputs:
targetPath: '$(Pipeline.Workspace)'
publishLocation: 'pipeline'
trigger:
- master