forked from koltyakov/gosip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
69 lines (60 loc) · 1.96 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
trigger:
- master
- dev
schedules:
- cron: "0 12 * * 0"
displayName: Weekly Sunday run
branches:
include:
- master
always: true
pool:
vmImage: "ubuntu-latest"
variables:
GO111MODULE: "on"
SPAUTH_CI: "true"
steps:
- task: GoTool@0
displayName: "Install Go"
inputs:
version: "1.18"
- script: |
go version
go get ./...
displayName: "Restore dependencies"
workingDirectory: "$(System.DefaultWorkingDirectory)"
- script: |
go test ./auth/... -race -coverprofile=auth_coverage.out -covermode=atomic
displayName: "Run auth tests"
workingDirectory: "$(System.DefaultWorkingDirectory)"
env:
SPAUTH_SITEURL: $(ci.spo.siteurl)
SPAUTH_USERNAME: $(ci.spo.username)
SPAUTH_PASSWORD: $(ci.spo.password)
SPAUTH_CLIENTID: $(ci.spo.clientid)
SPAUTH_CLIENTSECRET: $(ci.spo.clientsecret)
- script: |
go test ./ -v -count=1 -coverprofile=gosip_coverage.out -covermode=atomic && \
go test ./cpass/... -v -race -count=1 -coverprofile=cpass_coverage.out -covermode=atomic && \
go test ./csom/... -v -race -count=1 -coverprofile=csom_coverage.out -covermode=atomic
displayName: "Run util tests"
workingDirectory: "$(System.DefaultWorkingDirectory)"
- script: |
go test ./api/... -v -race -count=1 -coverprofile=api_coverage.out -covermode=atomic
displayName: "Run API tests"
workingDirectory: "$(System.DefaultWorkingDirectory)"
env:
SPAUTH_ENVCODE: spo
SPAPI_HEAVY_TESTS: true
GOMAXPROCS: 10
ENV_SPO_SITEURL: $(ci.spo.siteurl)
ENV_SPO_USERNAME: $(ci.spo.username)
ENV_SPO_PASSWORD: $(ci.spo.password)
GOSIP_TESTS_WEBHOOKS_URL: $(ci.spo.notificationsUrl)
- script: |
bash ./test/scripts/cover-merge.sh
bash <(curl -s https://codecov.io/bash)
displayName: "Publish code coverage"
workingDirectory: "$(System.DefaultWorkingDirectory)"
env:
CODECOV_TOKEN: $(ci.codecov.token)