Skip to content

Commit f4d814a

Browse files
committed
Added github action check
1 parent a54f508 commit f4d814a

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/check-easyjson.yml

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

0 commit comments

Comments
 (0)