-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
34 lines (29 loc) · 1.35 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
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: "ubuntu-latest"
steps:
- script: |
go get -d -v
go test -json > test-report.out
go test -coverprofile=coverage.out
displayName: "Run Golang test suite"
- script: |
go build -o main
displayName: "Build Go executable"
- script: |
export SONAR_SCANNER_VERSION=3.3.0.1492
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION
rm -rf $SONAR_SCANNER_HOME
mkdir -p $SONAR_SCANNER_HOME
curl -sSLo $HOME/.sonar/sonar-scanner.zip http://repo1.maven.org/maven2/org/sonarsource/scanner/cli/sonar-scanner-cli/$SONAR_SCANNER_VERSION/sonar-scanner-cli-$SONAR_SCANNER_VERSION.zip
unzip $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
rm $HOME/.sonar/sonar-scanner.zip
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
~/.sonar/sonar-scanner-3.3.0.1492/bin/sonar-scanner -Dsonar.projectKey=pact-to-karate -Dsonar.organization=monch1962-github -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=7b9b066b54ffcf4c4c22d0b89b38967a158d4f04 -Dsonar.scm.provider=git
displayName: "Run SonarCloud checks"