Skip to content

Commit e139925

Browse files
authored
Chore: CI (#2)
1 parent cd08ec2 commit e139925

File tree

4 files changed

+103
-5
lines changed

4 files changed

+103
-5
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Setup
2+
3+
inputs:
4+
python-version:
5+
description: "Python version to use"
6+
required: false
7+
default: 3.12
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Setup Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ inputs.python-version }}
20+
cache: 'pip'
21+
- name: Install dependencies
22+
shell: bash
23+
run: make install

.github/ci.workflow.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
jobs:
10+
11+
style:
12+
name: Style
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 30
15+
permissions:
16+
contents: "read"
17+
id-token: "write"
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref_name }}-style
20+
cancel-in-progress: true
21+
steps:
22+
- name: Setup Base
23+
uses: ./.github/actions/setup-base
24+
- name: Check style
25+
run: make style
26+
27+
unit-tests:
28+
name: Unit tests
29+
runs-on: ubuntu-latest
30+
needs: style
31+
timeout-minutes: 30
32+
permissions:
33+
contents: "read"
34+
id-token: "write"
35+
concurrency:
36+
group: ${{ github.workflow }}-${{ github.ref_name }}-unit-tests-${{ matrix.python_version }}
37+
cancel-in-progress: true
38+
strategy:
39+
matrix:
40+
python_version:
41+
- 3.9
42+
- 3.10
43+
- 3.11
44+
- 3.12
45+
- 3.13
46+
steps:
47+
- name: Setup Base
48+
uses: ./.github/actions/setup-base
49+
with:
50+
python-version: ${{ matrix.python_version }}
51+
- name: Run Unit Tests
52+
run: make test
53+
54+
integration-tests:
55+
name: Integration Tests
56+
runs-on: ubuntu-latest
57+
needs: style
58+
timeout-minutes: 30
59+
permissions:
60+
contents: "read"
61+
id-token: "write"
62+
concurrency:
63+
group: ${{ github.workflow }}-${{ github.ref_name }}-integration-tests
64+
cancel-in-progress: true
65+
steps:
66+
- name: Setup Base
67+
uses: ./.github/actions/setup-base
68+
- name: Setup Docker
69+
id: docker
70+
uses: docker/setup-docker-action@v4
71+
- name: Install dependencies
72+
run: make install
73+
- name: Run Integration Tests
74+
run: make integration-test

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ MODEL (
5050
name my_db.my_model,
5151
kind CUSTOM (
5252
materialization 'non_idempotent_incremental_by_time_range',
53-
materialization_properties (
54-
time_column = event_timestamp,
55-
primary_key (event_id, event_source)
56-
)
53+
time_column = event_timestamp,
54+
primary_key (event_id, event_source)
5755
)
5856
);
57+
58+
SELECT event_id, event_source, event_data, event_timestamp
59+
FROM upstream.table
5960
```
6061

6162
The properties are as follows:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Utilities for SQLMesh"
55
readme = "README.md"
66
requires-python = ">= 3.9"
77
dependencies = [
8-
"sqlmesh"
8+
"sqlmesh>=0.159.0"
99
]
1010

1111
[project.optional-dependencies]

0 commit comments

Comments
 (0)