Skip to content

Commit e2e8f0b

Browse files
authored
Chore: add github ci workflows (#41)
1 parent 81d7894 commit e2e8f0b

10 files changed

+362
-181
lines changed

.github/workflows/autofix.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Auto-fix when '/autofix' Slash Command is used
2+
3+
on:
4+
workflow_dispatch: {}
5+
repository_dispatch:
6+
types: [autofix-command]
7+
8+
jobs:
9+
python-autofix:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
- name: Set up Poetry
15+
uses: Gr1N/setup-poetry@v8
16+
with:
17+
poetry-version: "1.7.1"
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: 3.9
22+
cache: 'poetry'
23+
24+
- name: Install dependencies
25+
run: poetry install
26+
27+
- name: Format code
28+
run: poetry run ruff format .
29+
30+
- name: Commit changes
31+
run: |
32+
git config --global user.name "Airbyte Automation Bot"
33+
git config --global user.email "no-reply@airbyte.io"
34+
git add .
35+
git diff-index --quiet HEAD || git commit -m "Format code with black"
36+
37+
- name: Push changes
38+
uses: ad-m/github-push-action@master
39+
with:
40+
github_token: ${{ secrets.GITHUB_TOKEN }}
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Python Format Check
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request: {}
8+
9+
jobs:
10+
python-format-check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
- name: Set up Poetry
16+
uses: Gr1N/setup-poetry@v8
17+
with:
18+
poetry-version: "1.7.1"
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.10'
23+
cache: 'poetry'
24+
25+
- name: Install dependencies
26+
run: poetry install
27+
28+
- name: Check code format
29+
run: poetry run ruff format --check .

.github/workflows/python_lint.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Python Lint Check
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request: {}
8+
9+
jobs:
10+
python-lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
- name: Set up Poetry
16+
uses: Gr1N/setup-poetry@v8
17+
with:
18+
poetry-version: "1.7.1"
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.10'
23+
cache: 'poetry'
24+
25+
- name: Install dependencies
26+
run: poetry install
27+
28+
- name: Format code
29+
run: poetry run ruff check .

.github/workflows/python_pytest.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow will run pytest, prioritizing rebustness over speed.
2+
# This is in contrast to the 'failfast' workflow, which prioritizes speed over robustness.
3+
name: Pytest (All)
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request: {}
10+
11+
jobs:
12+
pytest:
13+
name: Pytest (All, Python ${{ matrix.python-version }})
14+
# Don't run on forks
15+
if: github.repository_owner == 'airbytehq'
16+
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
python-version: [
21+
# TODO: Re-enable 3.9 and 3.11 once we have stable tests across all versions.
22+
# '3.9',
23+
'3.10',
24+
# '3.11',
25+
]
26+
fail-fast: false
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
- name: Set up Poetry
32+
uses: Gr1N/setup-poetry@v8
33+
with:
34+
poetry-version: "1.7.1"
35+
- name: Set up Python
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
cache: 'poetry'
40+
41+
- name: Install dependencies
42+
run: poetry install
43+
44+
- name: Run Pytest
45+
env:
46+
GCP_GSM_CREDENTIALS: ${{ secrets.GCP_GSM_CREDENTIALS }}
47+
run: poetry run pytest
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will run pytest, prioritizing speed over robustness.
2+
# This is in contrast to the 'all' workflow, which prioritizes robustness over speed.
3+
name: Pytest (Fast Tests Only)
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request: {}
10+
11+
jobs:
12+
pytest-fast:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
- name: Set up Poetry
18+
uses: Gr1N/setup-poetry@v8
19+
with:
20+
poetry-version: "1.7.1"
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.10'
25+
cache: 'poetry'
26+
27+
- name: Install dependencies
28+
run: poetry install
29+
30+
- name: Run Pytest (Fast Tests Only)
31+
env:
32+
GCP_GSM_CREDENTIALS: ${{ secrets.GCP_GSM_CREDENTIALS }}
33+
run: poetry run pytest -m "not slow and not requires_creds" --exitfirst
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Slash Command Dispatch
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
slashCommandDispatch:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Slash Command Dispatch
12+
uses: peter-evans/slash-command-dispatch@v4
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+
commands: |
16+
autofix

airbyte/caches/base.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
2-
32
"""A SQL Cache implementation."""
43
from __future__ import annotations
54

0 commit comments

Comments
 (0)