Update docker-push.yml #30
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
name: Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
workflow_call: | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.18" | |
- 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: Verify dependencies | |
run: go mod verify | |
- name: lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. | |
version: v1.52 | |
args: --skip-files .*_test.go --enable wsl --enable misspell --out-format=colored-line-number --timeout 180s | |
- name: Build | |
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v cmd/clouddriver/clouddriver.go | |
- name: Test | |
run: go test -v ./... | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: test/credentials/test-keyfile.json | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
path: clouddriver |