Skip to content

Commit 7f393b1

Browse files
committed
Added github action check
1 parent f559fd7 commit 7f393b1

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/check-easyjson.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Check easyjson generated files
2+
3+
env:
4+
# See: https://github.com/actions/setup-go/tree/v2#readme
5+
GO_VERSION: "1.17"
6+
7+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
8+
on:
9+
push:
10+
paths:
11+
- ".github/workflows/check-easyjson.ya?ml"
12+
- "codecov.ya?ml"
13+
- "go.mod"
14+
- "go.sum"
15+
- "Taskfile.ya?ml"
16+
- "**.go"
17+
pull_request:
18+
paths:
19+
- ".github/workflows/check-easyjson.ya?ml"
20+
- "codecov.ya?ml"
21+
- "go.mod"
22+
- "go.sum"
23+
- "Taskfile.ya?ml"
24+
- "**.go"
25+
workflow_dispatch:
26+
repository_dispatch:
27+
28+
jobs:
29+
check-easyjson-generated-files:
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v3
35+
36+
- name: Install Go
37+
uses: actions/setup-go@v3
38+
with:
39+
go-version: ${{ env.GO_VERSION }}
40+
41+
- name: Install Task
42+
uses: arduino/setup-task@v1
43+
with:
44+
repo-token: ${{ secrets.GITHUB_TOKEN }}
45+
version: 3.x
46+
47+
- name: Regenerate easyjson source code
48+
run: task go:easyjson-generate
49+
50+
- name: Check for outdated cache
51+
id: diff
52+
run: |
53+
git add .
54+
if ! git diff --cached --color --exit-code; then
55+
echo
56+
echo "::error::easyjson generated files out of sync."
57+
exit 1
58+
fi

0 commit comments

Comments
 (0)