justlog/.github/workflows/ci.yml

44 lines
752 B
YAML
Raw Normal View History

2020-06-01 16:17:02 +02:00
name: ci
2020-11-18 17:42:00 +01:00
2020-06-01 16:14:03 +02:00
on:
push:
2022-02-26 13:57:27 +01:00
branches: [ main ]
2020-06-01 16:14:03 +02:00
pull_request:
2022-02-26 13:57:27 +01:00
branches: [ main ]
2020-06-01 16:14:03 +02:00
2020-11-18 17:40:05 +01:00
2020-06-01 16:14:03 +02: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 16:49:23 +01:00
release:
2022-02-26 13:57:27 +01:00
if: ${{ github.ref == 'refs/heads/main' }}
2020-11-18 16:50:40 +01:00
runs-on: ubuntu-latest
2020-11-18 16:49:23 +01:00
needs: build
2020-11-18 16:50:06 +01:00
steps:
2020-11-18 16:49:23 +01:00
2020-11-18 17:45:55 +01:00
- name: Set outputs
2020-11-18 17:42:00 +01:00
id: vars
run: echo "::set-output name=sha_short::$(echo ${{ github.sha }} | cut -c1-4)"