From 85ddd623f68541426867736a5ced861c5c6dcacd Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Thu, 19 Mar 2020 12:17:27 +0100 Subject: [PATCH] Add CI workflow --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..0fd378528 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: Continuous Integration + +on: push + +jobs: + ci: + runs-on: ubuntu-latest + container: + image: golang:1.14 + env: + GOFLAGS: -mod=vendor + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Run gofmt -s + 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 {} \; + exit 1; + fi + - name: Run tests + run: | + ./tests.sh + - name: Push on codecov result + uses: codecov/codecov-action@v1 + - name: Compile project on every platform + run: | + go get github.com/mitchellh/gox + gox -parallel 10 -os "linux freebsd netbsd windows" -osarch "darwin/i386 darwin/amd64"