-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (58 loc) · 1.54 KB
/
go-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
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Go CI
on:
push:
branches: [ main ]
pull_request:
paths:
- go-chaos/**
env:
GO_VERSION: 1.19
jobs:
go-ci:
name: Run Go CI
runs-on: ubuntu-latest
defaults:
run:
working-directory: go-chaos
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "${{ env.GO_VERSION }}"
- name: Go Format check
run: |
make fmt
diff=$(git status --porcelain)
if [ -n "$diff" ]
then
echo "Some files are not following the go format ($diff), run gofmt and fix your files."
exit 1
fi
- name: Install License Tool
run: make installLicense
- name: Check License
run: make checkLicense
- name: Run Go Tests
run: make test
auto-merge:
name: Auto-merge dependabot PRs
runs-on: ubuntu-latest
needs: [ go-ci ]
if: github.repository == 'zeebe-io/zeebe-chaos' && github.actor == 'dependabot[bot]'
permissions:
checks: read
pull-requests: write
steps:
- uses: actions/checkout@v3
- id: metadata
name: Fetch dependency metadata
uses: dependabot/fetch-metadata@v1.3.6
with:
github-token: "${{ secrets.AUTO_MERGE_GITHUB_TOKEN }}"
- id: merge
name: Merge PR
if: steps.metadata.outputs.update-type != 'version-update:semver-major'
run: gh pr merge ${{ github.event.pull_request.number }} --merge
env:
GITHUB_TOKEN: "${{ secrets.AUTO_MERGE_GITHUB_TOKEN }}"