-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (47 loc) · 1.16 KB
/
on-push.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Continuous Integration
on:
push:
branches:
- "**"
paths-ignore:
- "**.md"
jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Clone
uses: actions/checkout@v4
- id: setup-go
name: Setup GO
uses: actions/setup-go@v5
with:
go-version: ^1
- name: Download dependencies
if: steps.setup-go.outputs.cache-hit != 'true'
shell: bash
run: go get -t ./...
- name: Go fmt
run: test -z $(gofmt -l .)
shell: bash
- name: Go fmt-diff
if: failure()
run: gofmt -e -d .
shell: bash
- name: Go vet
if: success() || failure() # runs everytime except the job is cancelled
run: go vet ./...
shell: bash
- name: Golangci lint
uses: golangci/golangci-lint-action@v4
if: success() || failure() # runs everytime except the job is cancelled
with:
skip-pkg-cache: true
args: --timeout=1m
- name: Unit test
run: go test ./...
- name: Example
run: |
cd example
go get -t ./...
./run.sh