2020-06-01 10:17:02 -04:00
|
|
|
name: ci
|
2020-11-18 13:42:00 -03:00
|
|
|
|
2020-06-01 10:14:03 -04:00
|
|
|
on:
|
|
|
|
push:
|
2022-02-26 09:57:27 -03:00
|
|
|
branches: [ main ]
|
2020-06-01 10:14:03 -04:00
|
|
|
pull_request:
|
2022-02-26 09:57:27 -03:00
|
|
|
branches: [ main ]
|
2020-06-01 10:14:03 -04:00
|
|
|
|
2020-11-18 13:40:05 -03:00
|
|
|
|
2020-06-01 10:14:03 -04:00
|
|
|
jobs:
|
|
|
|
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Set up Go 1.x
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ^1.13
|
|
|
|
id: go
|
|
|
|
|
|
|
|
- name: Check out code into the Go module directory
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Get dependencies
|
|
|
|
run: |
|
|
|
|
go get -v -t -d ./...
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: go build -v .
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: go test -v .
|
2020-11-18 12:49:23 -03:00
|
|
|
|
|
|
|
release:
|
2022-02-26 09:57:27 -03:00
|
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
2020-11-18 12:50:40 -03:00
|
|
|
runs-on: ubuntu-latest
|
2020-11-18 12:49:23 -03:00
|
|
|
needs: build
|
2020-11-18 12:50:06 -03:00
|
|
|
steps:
|
2020-11-18 12:49:23 -03:00
|
|
|
|
2020-11-18 13:45:55 -03:00
|
|
|
- name: Set outputs
|
2020-11-18 13:42:00 -03:00
|
|
|
id: vars
|
2022-11-11 17:25:37 -03:00
|
|
|
run: echo "::set-output name=sha_short::$(echo ${{ github.sha }} | cut -c1-4)"
|