Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: add github ci workflows #41

Merged
merged 28 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c47a423
add github ci workflows
aaronsteers Feb 16, 2024
f33393a
fix lint
aaronsteers Feb 16, 2024
8656888
fix bugs
aaronsteers Feb 16, 2024
672c2f4
fix job names
aaronsteers Feb 16, 2024
f3b6862
consolidate boilerplate
aaronsteers Feb 16, 2024
8ad1406
add slash command
aaronsteers Feb 16, 2024
2ce7a12
add pytest
aaronsteers Feb 16, 2024
1afc12d
fix job names
aaronsteers Feb 16, 2024
ff8f35e
rename workflows
aaronsteers Feb 16, 2024
1ba0f47
fix docs
aaronsteers Feb 16, 2024
9e46090
sort dependencies
aaronsteers Feb 16, 2024
efa1ac6
clean up
aaronsteers Feb 16, 2024
9401b21
fix python version, add pytest python version matrix
aaronsteers Feb 16, 2024
805c6f4
fix arg
aaronsteers Feb 16, 2024
f43cc60
change name
aaronsteers Feb 16, 2024
65bc616
reference secrets.GCP_GSM_CREDENTIALS
aaronsteers Feb 16, 2024
44fd649
rename failfast
aaronsteers Feb 16, 2024
f945ca4
rename pytest (all)
aaronsteers Feb 16, 2024
f953281
match casing
aaronsteers Feb 16, 2024
a8a4792
rename lint job
aaronsteers Feb 16, 2024
9f5c07d
skip creds with failfast tests
aaronsteers Feb 16, 2024
ff3368b
skip tests that require creds when running on forks
aaronsteers Feb 16, 2024
e543ede
add tests for py3.9
aaronsteers Feb 16, 2024
06fac0a
try rename
aaronsteers Feb 16, 2024
937fe60
don't failfast
aaronsteers Feb 16, 2024
b968690
add comments describing workflows
aaronsteers Feb 16, 2024
d97b8bf
workaround: python tests on multi-version
aaronsteers Feb 16, 2024
0cf9b6a
update description
aaronsteers Feb 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Auto-fix when '/autofix' Slash Command is used

on:
workflow_dispatch: {}
repository_dispatch:
types: [autofix-command]

jobs:
python-autofix:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Poetry
uses: Gr1N/setup-poetry@v8
with:
poetry-version: "1.7.1"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: 'poetry'

- name: Install dependencies
run: poetry install

- name: Format code
run: poetry run ruff format .

- name: Commit changes
run: |
git config --global user.name "Airbyte Automation Bot"
git config --global user.email "[email protected]"
git add .
git diff-index --quiet HEAD || git commit -m "Format code with black"

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/python_format_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Python Format Check

on:
push:
branches:
- main
pull_request: {}

jobs:
python-format-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Poetry
uses: Gr1N/setup-poetry@v8
with:
poetry-version: "1.7.1"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'poetry'

- name: Install dependencies
run: poetry install

- name: Check code format
run: poetry run ruff format --check .
29 changes: 29 additions & 0 deletions .github/workflows/python_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Python Lint Check

on:
push:
branches:
- main
pull_request: {}

jobs:
python-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Poetry
uses: Gr1N/setup-poetry@v8
with:
poetry-version: "1.7.1"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'poetry'

- name: Install dependencies
run: poetry install

- name: Format code
run: poetry run ruff check .
47 changes: 47 additions & 0 deletions .github/workflows/python_pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow will run pytest, prioritizing rebustness over speed.
# This is in contrast to the 'failfast' workflow, which prioritizes speed over robustness.
name: Pytest (All)

on:
push:
branches:
- main
pull_request: {}

jobs:
pytest:
name: Pytest (All, Python ${{ matrix.python-version }})
# Don't run on forks
if: github.repository_owner == 'airbytehq'

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [
# TODO: Re-enable 3.9 and 3.11 once we have stable tests across all versions.
# '3.9',
'3.10',
# '3.11',
]
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Poetry
uses: Gr1N/setup-poetry@v8
with:
poetry-version: "1.7.1"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- name: Install dependencies
run: poetry install

- name: Run Pytest
env:
GCP_GSM_CREDENTIALS: ${{ secrets.GCP_GSM_CREDENTIALS }}
run: poetry run pytest
33 changes: 33 additions & 0 deletions .github/workflows/python_pytest_fast.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will run pytest, prioritizing speed over robustness.
# This is in contrast to the 'all' workflow, which prioritizes robustness over speed.
name: Pytest (Fast Tests Only)

on:
push:
branches:
- main
pull_request: {}

jobs:
pytest-fast:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Poetry
uses: Gr1N/setup-poetry@v8
with:
poetry-version: "1.7.1"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'poetry'

- name: Install dependencies
run: poetry install

- name: Run Pytest (Fast Tests Only)
env:
GCP_GSM_CREDENTIALS: ${{ secrets.GCP_GSM_CREDENTIALS }}
run: poetry run pytest -m "not slow and not requires_creds" --exitfirst
16 changes: 16 additions & 0 deletions .github/workflows/slash_command_dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Slash Command Dispatch

on:
issue_comment:
types: [created]

jobs:
slashCommandDispatch:
runs-on: ubuntu-latest
steps:
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commands: |
autofix
1 change: 0 additions & 1 deletion airbyte/caches/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.

"""A SQL Cache implementation."""
from __future__ import annotations

Expand Down
Loading
Loading