generated from kmdkuk/goct
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.35 KB
/
test_and_build.yml
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
49
50
51
52
name: CI
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, edited]
jobs:
prepare:
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.title, '[wip]') && !contains(github.event.pull_request.title, '[ci skip]') && !contains(github.event.pull_request.title, '[skip ci]')"
steps:
- run: echo "${{ github.event.pull_request.title }}"
test:
runs-on: ${{ matrix.os }}
needs: prepare
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- name: setup go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: go mod download
run: go mod download
- name: go install
run: make install-go-tools
- name: Ensure go.mod is already tidied
run: go mod tidy && git diff -s --exit-code go.sum
- name: build
run: make bin/git-push-notifier
- name: lint
run: make lint
- name: test
run: make test