-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: add github ci workflows (#41)
- Loading branch information
1 parent
81d7894
commit e2e8f0b
Showing
10 changed files
with
362 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.