From 55674f1928b67268b0b48606a1af014c8cd3bd4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20L=2E=20Hansen?= Date: Thu, 22 Apr 2021 12:50:52 -0700 Subject: [PATCH] Run tests on push --- .github/workflows/main.yaml | 25 +++++++++++++++++++++++++ Makefile | 1 + 2 files changed, 26 insertions(+) create mode 100644 .github/workflows/main.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..a1afc51 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,25 @@ +name: Go + +on: + push: + branches: [ gh-workflows ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + + - name: Test + run: make test + + - name: Build + run: make tools cross_compile diff --git a/Makefile b/Makefile index 3144cc1..f283fc5 100644 --- a/Makefile +++ b/Makefile @@ -79,6 +79,7 @@ tools: test: if [ `go fmt $(go list ./... | grep -v /vendor/) | wc -l` -gt 0 ]; then echo "go fmt error"; exit 1; fi + go test ./... cross_compile: GOARM=5 gox -os="darwin linux freebsd netbsd openbsd solaris" -arch="386 amd64 arm arm64" -osarch="!darwin/386" -osarch="!darwin/arm" $(BUILD_OPTIONS) -output "${OUTPUT_DIR}/pkg/{{.OS}}_{{.Arch}}/{{.Dir}}"