forked from parcel-bundler/parcel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-template.yml
89 lines (85 loc) · 3.38 KB
/
azure-pipelines-template.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
81
82
83
84
85
86
87
88
89
jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
node_12_x:
node_version: 12.x
node_14_x:
node_version: 14.x
maxParallel: 3
variables:
# From https://docs.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops
CARGO_HOME: $(Pipeline.Workspace)/.cargo
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: 'Install Node.js'
# Install Rust
- ${{ if ne(parameters.name, 'Windows') }}:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
export PATH="$HOME/.cargo/bin:$PATH"
echo "##vso[task.setvariable variable=PATH]$PATH"
rustc -Vv
cargo -V
displayName: Install Rust
- ${{ if eq(parameters.name, 'Windows') }}:
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain stable --default-host x86_64-pc-windows-msvc
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
echo "##vso[task.setvariable variable=PATH]%PATH%;%USERPROFILE%\.cargo\bin"
rustc -Vv
cargo -V
displayName: Install Rust
- ${{ if eq(parameters.name, 'Linux') }}:
- script: |
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p;
displayName: Bump max inotify watches
# From https://docs.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops
- task: Cache@2
inputs:
key: 'cargo | "$(Agent.OS)" | Cargo.lock'
restoreKeys: |
cargo | "$(Agent.OS)"
cargo
path: $(CARGO_HOME)
displayName: Cache Cargo directory
# Like yarn --frozen-lockfile, fails immediately if lockfile needs updates
- script: cargo fetch --locked
displayName: 'Fetch cargo dependencies'
- script: cargo test --all
displayName: 'Run Rust tests'
# From https://docs.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops
- task: Cache@2
inputs:
key: 'yarn | "$(Agent.OS)" | yarn.lock'
restoreKeys: |
yarn | "$(Agent.OS)"
yarn
path: $(YARN_CACHE_FOLDER)
displayName: Cache yarn directory
# use `--frozen-lockfile` to fail immediately if the committed yarn.lock needs updates
# https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-frozen-lockfile
- script: yarn --frozen-lockfile
displayName: 'Install dependencies'
- script: yarn build-native-release
displayName: 'Build native packages'
- script: yarn test:unit
displayName: 'Run unit tests'
- script: yarn test:integration-ci
displayName: 'Run integration tests'
- script: yarn flow check
displayName: 'Type check with Flow'
- script: yarn lint
displayName: 'Lint'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/junit-*.xml'
testRunTitle: TestRun ${{ parameters.name }} $(node_version)