Add renovate.json #40
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: CI (Build, Lint, Test) | |
on: | |
# pull_request: | |
# paths: | |
# - '**' | |
# - '!readme.md' | |
# - '!stack.yml' | |
# - '!.idea/**' | |
push: | |
paths: | |
- '**' | |
- '!readme.md' | |
- '!stack.yml' | |
- '!.idea/**' | |
tags: | |
- '**' | |
- '!v*.*' | |
branches: | |
- '**' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.13 | |
uses: actions/setup-go@v1 | |
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 linux_amd64 | |
run: GOOS=linux GOARCH=amd64 go build -o octopod_linux -v ./cmd/server | |
- name: Build windows_amd64 | |
run: GOOS=windows GOARCH=amd64 go build -o octopod_win32nt.exe -v ./cmd/server | |
- name: Build darwin_amd64 | |
run: GOOS=darwin GOARCH=amd64 go build -o octopod_darwin -v ./cmd/server | |
- name: Build freebsd_amd64 | |
run: GOOS=freebsd GOARCH=amd64 go build -o octopod_freebsd -v ./cmd/server | |
- name: Docker Build | |
run: docker build -t octopod:1 . | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.13 | |
- name: Check out code | |
uses: actions/checkout@v1 | |
- name: Lint Go Code | |
run: | | |
export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14 | |
go get -u golang.org/x/lint/golint | |
golint -set_exit_status ./... | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.13 | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: get docker info | |
run: docker info | |
- name: Initialize Swarm | |
run: docker swarm init | |
- name: Deploy testing stack | |
run: docker stack deploy -c ./internal/testing.stack.yml testing | |
- name: Run Unit tests. | |
run: go test ./... -coverprofile=coverage.txt -covermode=atomic | |
- name: Upload Coverage report to CodeCov | |
uses: codecov/[email protected] | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
file: ./coverage.txt |