-
Notifications
You must be signed in to change notification settings - Fork 102
99 lines (84 loc) · 2.87 KB
/
push.yml
File metadata and controls
99 lines (84 loc) · 2.87 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: build
on:
pull_request:
types: [opened, synchronize]
merge_group:
types: [checks_requested]
push:
# Always run on push to main. The build cache can only be reused
# if it was saved by a run from the repository's default branch.
# The run result will be identical to that from the merge queue
# because the commit is identical, yet we need to perform it to
# seed the build cache.
branches:
- main
permissions:
contents: read
jobs:
ci:
runs-on:
group: databrickslabs-protected-runner-group
labels: linux-ubuntu-latest
permissions:
# Authenticate with JFrog for package resolution.
id-token: write
strategy:
fail-fast: false
matrix:
pyVersion: [ '3.10', '3.11', '3.12', '3.13' ]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Setup uv
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
with:
version: "0.11.2"
checksum: "7ac2ca0449c8d68dae9b99e635cd3bc9b22a4cb1de64b7c43716398447d42981"
- name: Setup for JFrog
uses: ./.github/actions/jfrog-auth
- name: Run unit tests
run: make test
env:
UV_PYTHON: ${{ matrix.pyVersion }}
- name: Publish test coverage
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
fmt:
runs-on:
group: databrickslabs-protected-runner-group
labels: linux-ubuntu-latest
permissions:
# Authenticate with JFrog for package resolution.
id-token: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Setup uv
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
with:
version: "0.11.2"
checksum: "7ac2ca0449c8d68dae9b99e635cd3bc9b22a4cb1de64b7c43716398447d42981"
- name: Setup for JFrog
uses: ./.github/actions/jfrog-auth
- name: Reformat code
run: make fmt
- name: Install Databricks CLI
uses: databricks/setup-cli@8db12393ac48926ab0074f3928f36c7abc441f90 # v0.292.0
- name: Install LSQL
run: |
databricks labs install lsql --log-level=trace
databricks labs installed
env: # this is a temporary hack
DATABRICKS_HOST: any
DATABRICKS_TOKEN: any
- name: Reformat SQL queries
run: databricks labs lsql fmt --normalize-case false --exclude tests/unit/source_code/samples/
- name: Fail on differences
run: |
# Exit with status code 1 if there are differences (i.e. unformatted files)
git diff --exit-code