-
Notifications
You must be signed in to change notification settings - Fork 59
53 lines (43 loc) · 1.29 KB
/
diff.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
# Build generated files with JSonnet and show diff output.
name: Diff Generated Files
on:
pull_request:
branches: [master]
types: [opened, synchronize, edited]
workflow_dispatch: {}
jobs:
diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Go environment
uses: actions/setup-go@v2
with:
go-version: '1.17'
- name: Install JSonnet
run: |
go install github.com/google/go-jsonnet/cmd/jsonnet@latest
go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
echo "$HOME/go/bin" >> $GITHUB_PATH
- name: Format JSonnet files (diff should be empty)
run: |
scripts/format-jsonnet.sh
git add -N tests/ templates/
git diff --exit-code
- name: Build repository
run: |
scripts/gen-tests.sh
- name: Show git diff summary
run: |
# New files need to be added before git diff will recognize them.
git add -N k8s/
git fetch origin gen
git diff origin/gen --compact-summary -- k8s/ || true
- name: Show full git diff
run: |
git diff origin/gen -- k8s/ | tee generated.diff
- name: Upload a diff file
uses: actions/[email protected]
with:
name: diff
path: generated.diff