2020-03-19 13:17:27 +02:00
|
|
|
name: Continuous Integration
|
|
|
|
|
2020-05-04 20:03:27 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2020-08-25 09:18:29 +02:00
|
|
|
- master
|
2020-08-25 09:16:13 +02:00
|
|
|
pull_request:
|
2020-03-19 13:17:27 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
GOFLAGS: -mod=vendor
|
|
|
|
steps:
|
2020-03-20 15:27:22 +02:00
|
|
|
- name: Checkout code
|
2020-03-19 13:17:27 +02:00
|
|
|
uses: actions/checkout@v2
|
2020-03-20 15:27:22 +02:00
|
|
|
- name: Setup Go
|
2020-03-20 15:18:44 +02:00
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
2021-02-19 10:04:43 +02:00
|
|
|
go-version: 1.16.x
|
2020-03-20 15:27:22 +02:00
|
|
|
- name: Cache build
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cache/go-build
|
|
|
|
key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}
|
|
|
|
restore-keys: |
|
|
|
|
${{runner.os}}-go-
|
|
|
|
- name: Format code
|
2020-03-19 13:17:27 +02:00
|
|
|
run: |
|
|
|
|
if [ $(find . ! -path "./vendor/*" -name "*.go" -exec gofmt -s -d {} \;|wc -l) -gt 0 ]; then
|
|
|
|
find . ! -path "./vendor/*" -name "*.go" -exec gofmt -s -d {} \;
|
2020-03-20 15:39:34 +02:00
|
|
|
exit 1
|
2020-03-19 13:17:27 +02:00
|
|
|
fi
|
2020-03-20 15:27:22 +02:00
|
|
|
- name: Test code
|
2020-03-19 13:17:27 +02:00
|
|
|
run: |
|
2020-03-19 13:21:23 +02:00
|
|
|
./test.sh
|
2020-03-25 11:51:04 +02:00
|
|
|
- name: Build binaries
|
2020-03-25 12:03:59 +02:00
|
|
|
uses: goreleaser/goreleaser-action@v1
|
|
|
|
with:
|
|
|
|
args: --skip-publish --snapshot
|