diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7ac822f..d31e87f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,17 +1,37 @@ -workspace: - base: /srv/drone-demo - path: . +name: Go + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: -pipeline: build: - image: golang - # pull: true - commands: - - pwd - - ls - - go env -w GOPROXY=https://goproxy.io,direct - - go get -u github.com/aliyun/alibaba-cloud-sdk-go/sdk - - go get -u github.com/aliyun/alibaba-cloud-sdk-go/services/alidns - - go mod init alidns - - go mod tidy - - go build alidns.go + name: Build + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.13 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Get dependencies + run: | + go get -v -t -d ./... + if [ -f Gopkg.toml ]; then + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure + fi + + - name: Build + run: go build -v . + + - name: Test + run: go test -v .