From 9b8e7ff1baf68da72e9f4db763348de5f34de7f4 Mon Sep 17 00:00:00 2001 From: jiacai_wang Date: Sun, 25 Apr 2021 14:49:37 +0800 Subject: [PATCH] Revert "modify github workflow" This reverts commit 3ab0f8aa2ebf2ce9617b9e31f3b0b353d59c6d50. --- .github/workflows/go.yml | 50 ++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 15 deletions(-) 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 .