-
Notifications
You must be signed in to change notification settings - Fork 71
45 lines (43 loc) · 1.31 KB
/
schema.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
name: Check schema compatibility
on:
pull_request:
push:
branches: [ main ]
jobs:
check-generate-schema:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Need fetch-depth 0 to fetch tags, see https://github.com/actions/checkout/issues/701
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path:
requirements.txt
- name: Install libsnappy-dev
run: sudo apt install libsnappy-dev
- name: Install requirements
run: make install-dev
# Compare with latest release when running on main.
- run: |
source ./venv/bin/activate
make schema against=$(git describe --abbrev=0 --tags)
if: github.ref == 'refs/heads/main'
# Compare with main when running on branches/PRs.
- run: |
source ./venv/bin/activate
make schema
if: github.ref != 'refs/heads/main'
- run: |
diff=$(git --no-pager diff)
if [[ ! -z "$diff" ]]; then
echo "💥 Non-empty output from git diff, please run `make schema`."
echo
echo "$diff"
exit 1
else
echo "✅ No diff after generating schema."
fi