forgejo-federation/vendor/github.com/mholt/archiver/v3/azure-pipelines.yml
6543 12a1f914f4
Vendor Update Go Libs (#13166)
* update github.com/alecthomas/chroma v0.8.0 -> v0.8.1

* github.com/blevesearch/bleve v1.0.10 -> v1.0.12

* editorconfig-core-go v2.1.1 -> v2.3.7

* github.com/gliderlabs/ssh v0.2.2 -> v0.3.1

* migrate editorconfig.ParseBytes to Parse

* github.com/shurcooL/vfsgen to 0d455de96546

* github.com/go-git/go-git/v5 v5.1.0 -> v5.2.0

* github.com/google/uuid v1.1.1 -> v1.1.2

* github.com/huandu/xstrings v1.3.0 -> v1.3.2

* github.com/klauspost/compress v1.10.11 -> v1.11.1

* github.com/markbates/goth v1.61.2 -> v1.65.0

* github.com/mattn/go-sqlite3 v1.14.0 -> v1.14.4

* github.com/mholt/archiver v3.3.0 -> v3.3.2

* github.com/microcosm-cc/bluemonday 4f7140c49acb -> v1.0.4

* github.com/minio/minio-go v7.0.4 -> v7.0.5

* github.com/olivere/elastic v7.0.9 -> v7.0.20

* github.com/urfave/cli v1.20.0 -> v1.22.4

* github.com/prometheus/client_golang v1.1.0 -> v1.8.0

* github.com/xanzy/go-gitlab v0.37.0 -> v0.38.1

* mvdan.cc/xurls v2.1.0 -> v2.2.0

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-10-16 01:06:27 -04:00

108 lines
3.3 KiB
YAML
Vendored

trigger:
- master
strategy:
matrix:
linux:
imageName: ubuntu-18.04
gorootDir: /usr/local
mac:
# Mojave
imageName: macos-10.14
gorootDir: /usr/local
windows:
imageName: windows-2019
gorootDir: C:\
pool:
vmImage: $(imageName)
variables:
GOROOT: $(gorootDir)/go
GOPATH: $(system.defaultWorkingDirectory)/gopath
GOBIN: $(GOPATH)/bin
modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)'
# TODO: Enable modules after upstream dependency zstd supports them
# TODO: modules should be the default in Go 1.13, so this won't be needed
#GO111MODULE: on
steps:
- bash: git config --global core.autocrlf false
displayName: "Disable line ending conversion for git to"
- checkout: self
- bash: |
latestGo=$(curl "https://golang.org/VERSION?m=text")
echo "##vso[task.setvariable variable=LATEST_GO]$latestGo"
echo "Latest Go version: $latestGo"
displayName: "Get latest Go version"
- bash: |
sudo rm -f $(which go)
echo '##vso[task.prependpath]$(GOBIN)'
echo '##vso[task.prependpath]$(GOROOT)/bin'
mkdir -p '$(modulePath)'
shopt -s extglob
shopt -s dotglob
mv !(gopath) '$(modulePath)'
displayName: Remove old Go, set GOBIN/GOROOT, and move project into GOPATH
# Install Go (this varies by platform)
- bash: |
wget "https://dl.google.com/go/$(LATEST_GO).linux-amd64.tar.gz"
sudo tar -C $(gorootDir) -xzf "$(LATEST_GO).linux-amd64.tar.gz"
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: Install Go on Linux
- bash: |
wget "https://dl.google.com/go/$(LATEST_GO).darwin-amd64.tar.gz"
sudo tar -C $(gorootDir) -xzf "$(LATEST_GO).darwin-amd64.tar.gz"
condition: eq( variables['Agent.OS'], 'Darwin' )
displayName: Install Go on macOS
- powershell: |
echo "Downloading Go..."
# Windows comes with BSD curl, which is MUCH faster than the native Windows HTTP
curl.exe -fsSL -o "$(LATEST_GO).windows-amd64.zip" "https://dl.google.com/go/$(LATEST_GO).windows-amd64.zip"
echo "Extracting Go..."
# Yes, Windows tar (BSD tar) handles zip files. Who knew!?
# (and it's MUCH, MUCH, MUCH faster than the native Windows expander)
tar.exe xf "$(LATEST_GO).windows-amd64.zip" -C "$(gorootDir)"
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: Install Go on Windows
- bash: |
printf "Using go at: $(which go)\n"
printf "Go version: $(go version)\n"
printf "\n\nGo environment:\n\n"
go env
printf "\n\nSystem environment:\n\n"
env
displayName: Print Go version and environment
- bash: |
go mod tidy
if [ ! -z "$(git status --porcelain go.mod)" ]; then
printf "go.mod has modifications\n"
git diff go.mod
exit 1
fi
if [ ! -z "$(git status --porcelain go.sum)" ]; then
printf "go.sum has modifications\n"
git diff go.sum
exit 1
fi
workingDirectory: '$(modulePath)'
displayName: Ensure that module definition and checksums are correct
- script: |
go get -v -t d ./...
# ensure that the CORRECT golangci-list (as per go.mod) is run
go mod vendor
go run -mod=vendor github.com/golangci/golangci-lint/cmd/golangci-lint run -E gofmt -E goimports -E misspell
go test -race ./...
workingDirectory: '$(modulePath)'
displayName: Run tests