2020-07-04 21:29:03 +00:00
|
|
|
name: "Build & Test"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: '^1.14.2'
|
2020-07-04 21:44:22 +00:00
|
|
|
|
2020-07-04 21:29:03 +00:00
|
|
|
- name: Build
|
2020-07-04 21:44:22 +00:00
|
|
|
run: GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -ldflags "-X system.Version=dev-${GIT_COMMIT:0:7}" -o build/wings_linux_amd64 -v wings.go
|
|
|
|
|
2020-07-04 21:29:03 +00:00
|
|
|
- name: Test
|
|
|
|
run: go test ./...
|
2020-07-04 21:44:22 +00:00
|
|
|
|
2020-07-04 21:29:03 +00:00
|
|
|
- name: Compress binary
|
2020-07-04 21:54:03 +00:00
|
|
|
if: ${{ github.ref == "develop" }}
|
|
|
|
run: upx build/wings_linux_amd64
|
2020-07-04 21:44:22 +00:00
|
|
|
|
2020-07-04 21:29:03 +00:00
|
|
|
- uses: actions/upload-artifact@v2
|
2020-07-04 21:54:03 +00:00
|
|
|
if: ${{ github.ref == "develop" }}
|
2020-07-04 21:29:03 +00:00
|
|
|
with:
|
2020-07-04 21:44:22 +00:00
|
|
|
name: wings_linux_amd64
|
2020-07-04 21:29:03 +00:00
|
|
|
path: build/wings_linux_amd64
|