2022-06-23 14:29:39 +00:00
|
|
|
name: Go
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "master" ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ "master" ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-06-23 14:33:52 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2022-06-23 14:29:39 +00:00
|
|
|
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: 1.18
|
2022-06-23 14:40:33 +00:00
|
|
|
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/go-build
|
|
|
|
~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
2022-06-23 14:29:39 +00:00
|
|
|
|
|
|
|
- name: Build
|
2022-06-23 14:33:52 +00:00
|
|
|
run: make build
|
2022-06-23 14:29:39 +00:00
|
|
|
|
|
|
|
- name: Test
|
2022-06-23 14:33:52 +00:00
|
|
|
run: make test
|
|
|
|
|
|
|
|
# Test if anything changed (maining a generator or manifest changed
|
|
|
|
- name: git diff
|
|
|
|
run: git diff --no-ext-diff --quiet --exit-code
|