Skip to content

Commit 4eae6d5

Browse files
authored
chore(ci): Add square CI (#12705)
#### Summary Adds CI for the Square plugin <!--
1 parent 9975e57 commit 4eae6d5

6 files changed

Lines changed: 71 additions & 1 deletion

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Source Plugin Squre Workflow
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
paths:
10+
- "plugins/source/square/**"
11+
- ".github/workflows/source_square.yml"
12+
push:
13+
branches:
14+
- main
15+
paths:
16+
- "plugins/source/square/**"
17+
- ".github/workflows/source_square.yml"
18+
19+
jobs:
20+
plugins-source-square:
21+
timeout-minutes: 30
22+
name: "plugins/source/square"
23+
runs-on: large-ubuntu-monorepo
24+
defaults:
25+
run:
26+
working-directory: ./plugins/source/square
27+
steps:
28+
- uses: actions/checkout@v3
29+
- name: Set up Python
30+
uses: actions/setup-python@v4
31+
with:
32+
python-version: '3.x'
33+
- name: Install dependencies
34+
run: pip install -r requirements.txt
35+
- name: Check formatting
36+
run: make fmt-check
37+
- name: Run tests
38+
run: make test
39+
40+
validate-release:
41+
timeout-minutes: 10
42+
runs-on: large-ubuntu-monorepo
43+
env:
44+
IMAGE_NAME_PREFIX: cloudquery
45+
REGISTRY: ghcr.io
46+
steps:
47+
- name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1
49+
50+
- name: Build and push Docker image
51+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
52+
with:
53+
context: "{{defaultContext}}:plugins/source/square"
54+
load: true

plugins/source/square/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
test:
2+
pytest .
3+
4+
fmt:
5+
black . --exclude=cloudquery
6+
7+
fmt-check:
8+
black --check . --exclude=cloudquery
9+

plugins/source/square/plugin/plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ def init(self, spec_bytes):
2424
self._spec_json = json.loads(spec_bytes)
2525
self._spec = Spec(**self._spec_json)
2626
self._spec.validate()
27-
self._scheduler = Scheduler(self._spec.concurrency, self._spec.queue_size, logger=self._logger)
27+
self._scheduler = Scheduler(
28+
self._spec.concurrency, self._spec.queue_size, logger=self._logger
29+
)
2830
self._client = Client(self._spec)
2931

3032
def get_tables(self, options: plugin.TableOptions) -> List[plugin.Table]:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
black==23.7.0
12
cloudquery-plugin-sdk==0.0.8
23
pyarrow==12.0.1
34
squareup==29.0.0.20230720
5+
pytest==7.4.0

plugins/source/square/tests/plugin/plugin.py

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
def test_plugin():
2+
# TODO: Implement test
3+
pass

0 commit comments

Comments
 (0)