-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (39 loc) · 1.08 KB
/
ci.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
name: CI
on:
push:
branches: [ main ]
tags: [ v* ] #trigger on tags start with v, eg v1.0.0
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
diff:
runs-on: ubuntu-latest
outputs:
golang: ${{ steps.filter.outputs.golang }}
js: ${{ steps.filter.outputs.js }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
base: 'main'
filters: |
golang:
- "modelschemas/**"
- "schemasv1/**"
golint:
runs-on: ubuntu-latest
needs:
- diff
if: ${{ (github.event_name == 'pull_request' && needs.diff.outputs.golang == 'true') || github.event_name == 'push' }}
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.18' # The Go version to download (if necessary) and use.
- uses: actions/checkout@v2
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2.5.2
concurrency:
group: yatai${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true