summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjarkk <mkopenga@gmail.com>2021-07-27 22:03:37 +0200
committermjarkk <mkopenga@gmail.com>2021-07-28 15:40:06 +0200
commit3db40a79fe9d440698070ef873d1e154dcd57ed9 (patch)
tree739c58fd8be6c0bbe6d86689d66a7c8ded069217
parent62393cf28a13fd658fa200015c3aec08ea5584bb (diff)
Sperate gh action build step
-rw-r--r--.github/workflows/ci.yml38
-rw-r--r--.github/workflows/lint.yml6
2 files changed, 34 insertions, 10 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e5cbd72b1..14857c44d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -22,19 +22,37 @@ jobs:
uses: actions/cache@v1
with:
path: ~/.cache/go-build
- key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}
+ key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}-test
restore-keys: |
${{runner.os}}-go-
- - name: Format code
- 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: Test code
run: |
./test.sh
- - name: Build binaries
- uses: goreleaser/goreleaser-action@v1
+ build:
+ runs-on: ubuntu-latest
+ env:
+ GOFLAGS: -mod=vendor
+ GOARCH: amd64
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+ - name: Setup Go
+ uses: actions/setup-go@v1
with:
- args: --skip-publish --snapshot
+ go-version: 1.16.x
+ - name: Cache build
+ uses: actions/cache@v1
+ with:
+ path: ~/.cache/go-build
+ key: ${{runner.os}}-go-${{hashFiles('**/go.sum')}}-build
+ restore-keys: |
+ ${{runner.os}}-go-
+ - name: Build linux binary
+ run: |
+ GOOS=linux go build
+ - name: Build windows binary
+ run: |
+ GOOS=windows go build
+ - name: Build darwin binary
+ run: |
+ GOOS=darwin go build
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 25659077e..08e339d8d 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -12,3 +12,9 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
version: latest
+ - name: Format code
+ 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