This repository was archived by the owner on Nov 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.azure.yml
85 lines (71 loc) · 2.31 KB
/
.azure.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
variables:
PATH_SERVER: 'uit.hotel'
PATH_SERVER_TEST: 'uit.hotel.test'
PATH_CLIENT: 'uit.hotel.client'
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
NODE_CACHE_FOLDER: $(System.DefaultWorkingDirectory)/$(PATH_CLIENT)/node_modules
jobs:
- job: DotNetCore
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Cache@2
inputs:
key: nuget | $(Agent.OS) | .azure.yml
path: $(NUGET_PACKAGES)
restoreKeys: |
nuget | $(Agent.OS)
displayName: '[Cache] Cache Nuget packages'
- script: dotnet --info
displayName: '[Server] Run `dotnet --info`'
- script: dotnet restore
condition: ne(variables.CACHE_RESTORED, 'true')
displayName: '[Server] Run `dotnet restore`'
- script: dotnet build --no-restore
displayName: '[Server] Run `dotnet build`'
- script: dotnet test --no-build
displayName: '[Server] Run `dotnet test`'
- job: NodeJS
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Cache@2
inputs:
key: yarn | $(Agent.OS) | $(PATH_CLIENT)/yarn.lock | .azure.yml
path: $(YARN_CACHE_FOLDER)
restoreKeys: |
yarn | $(Agent.OS)
displayName: '[Cache] Cache Yarn packages'
- task: Cache@2
inputs:
key: node | $(Agent.OS) | $(PATH_CLIENT)/yarn.lock | .azure.yml
path: $(NODE_CACHE_FOLDER)
displayName: Cache Node Modules
- task: UseNode@1
inputs:
version: '12.x'
checkLatest: true
displayName: '[Client] Install NodeJS'
- script: |
cd $(PATH_CLIENT)
yarn
yarn cache list
condition: ne(variables['CacheRestored'], 'true')
displayName: '[Client] Run `yarn install`'
- script: |
cd $(PATH_CLIENT)
yarn lint:js --max-warnings=0
displayName: '[Client] Run `yarn lint:js`'
- script: |
cd $(PATH_CLIENT)
yarn lint:css
displayName: '[Client] Run `yarn lint:css`'
- script: |
cd $(PATH_CLIENT)
yarn build
displayName: '[Client] Run `yarn build`'
- script: |
cd $(PATH_CLIENT)
yarn test
displayName: '[Client] Run `yarn test`'