Skip to content

Commit

Permalink
Merge branch 'aj/ci/add-github-workflows' into dependabot/github_acti…
Browse files Browse the repository at this point in the history
…ons/tj-actions/changed-files-45
  • Loading branch information
aaronsteers authored Nov 12, 2024
2 parents 6c3ef01 + 871555d commit f9810f3
Show file tree
Hide file tree
Showing 17 changed files with 85 additions and 59 deletions.
14 changes: 14 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,17 @@ autolabeler:
- label: 'enhancement'
title:
- '/^feat(\(.*\))?/i'
- label: 'docs'
title:
- '/^docs(\(.*\))?\:/i'
- label: 'security'
title:
- '/^security(\(.*\))?\:/i'
- '/^fix(\(security\))?\:/i'
- label: 'dependencies'
title:
- '/^chore\(deps\)\:/i'
- '/^build\(deps\)\:/i'
- label: 'breaking'
title:
- '/!:\s*$/i'
12 changes: 3 additions & 9 deletions .github/workflows/connector-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
if: ${{ matrix.cdk_extra != 'n/a' && needs.cdk_changes.outputs[matrix.cdk_extra] == 'false' }}
run: |
echo "Aborting job as specified extra not changed: ${{matrix.cdk_extra}} = ${{ needs.cdk_changes.outputs[matrix.cdk_extra] }}"
echo "::set-output name=status::cancelled"
echo "status=cancelled" >> $GITHUB_OUTPUT
exit 1
continue-on-error: true
# Get the monorepo so we can test the connectors
Expand All @@ -109,17 +109,11 @@ jobs:
with:
repository: airbytehq/airbyte
ref: master
- name: Fetch last commit id from remote branch [PULL REQUESTS]
if: github.event_name == 'pull_request' && steps.no_changes.outcome != 'failure'
id: fetch_last_commit_id_pr
run: echo "commit_id=$(git ls-remote --heads origin refs/heads/${{ github.head_ref }} | cut -f 1)" >> $GITHUB_OUTPUT
- name: Fetch last commit id from remote branch [WORKFLOW DISPATCH]
if: github.event_name == 'workflow_dispatch' && steps.no_changes.outcome != 'failure'
id: fetch_last_commit_id_wd
run: echo "commit_id=$(git rev-parse origin/${{ steps.extract_branch.outputs.branch }})" >> $GITHUB_OUTPUT
- name: Test Connector
if: steps.no_changes.outcome != 'failure'
timeout-minutes: 90
env:
GCP_GSM_CREDENTIALS: ${{ secrets.GCP_GSM_CREDENTIALS }}
run: |
make tools.airbyte-ci-binary.install
airbyte-ci connectors \
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/fix-pr-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ on:
type: string
required: false

env:
AIRBYTE_ANALYTICS_ID: ${{ vars.AIRBYTE_ANALYTICS_ID }}

jobs:
# This is copied from the `python_pytest.yml` file.
# Only the first two steps of the job are different, and they check out the PR's branch.
Expand Down Expand Up @@ -51,8 +48,8 @@ jobs:
id: pr-info
run: |
PR_JSON=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.inputs.pr }})
echo "::set-output name=repo::$(echo "$PR_JSON" | jq -r .head.repo.full_name)"
echo "::set-output name=branch::$(echo "$PR_JSON" | jq -r .head.ref)"
echo "repo=$(echo "$PR_JSON" | jq -r .head.repo.full_name)" >> $GITHUB_OUTPUT
echo "branch=$(echo "$PR_JSON" | jq -r .head.ref)" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
Expand Down Expand Up @@ -104,7 +101,7 @@ jobs:
- name: Check for changes
id: git-diff
run: |
git diff --quiet && echo "No changes to commit" || echo "::set-output name=changes::true"
git diff --quiet && echo "No changes to commit" || echo "changes=true" >> $GITHUB_OUTPUT
shell: bash

# Commit changes (if any)
Expand All @@ -129,7 +126,7 @@ jobs:
- name: Check for changes ('unsafe' fixes)
id: git-diff-2
run: |
git diff --quiet && echo "No changes to commit" || echo "::set-output name=changes::true"
git diff --quiet && echo "No changes to commit" || echo "changes=true" >> $GITHUB_OUTPUT
shell: bash

- name: Commit 'unsafe' lint fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
- main
pull_request: {}

env:
AIRBYTE_ANALYTICS_ID: ${{ vars.AIRBYTE_ANALYTICS_ID }}

jobs:
preview_docs:
runs-on: ubuntu-latest
Expand All @@ -31,10 +28,15 @@ jobs:

- name: Generate documentation
run: |
set -e
poetry run poe docs-generate
if [ ! -d "docs/generated" ]; then
echo "Error: Documentation generation failed - docs/generated directory not found"
exit 1
fi
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
# Upload generated documentation
path: 'docs/generated'
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
AIRBYTE_ANALYTICS_ID: ${{ vars.AIRBYTE_ANALYTICS_ID }}

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/poetry-lock-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ on:
type: string
required: false

env:
AIRBYTE_ANALYTICS_ID: ${{ vars.AIRBYTE_ANALYTICS_ID }}

jobs:
poetry-lock-on-demand:
name: On-Demand Poetry Lock
Expand Down Expand Up @@ -48,8 +45,8 @@ jobs:
id: pr-info
run: |
PR_JSON=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.inputs.pr }})
echo "::set-output name=repo::$(echo "$PR_JSON" | jq -r .head.repo.full_name)"
echo "::set-output name=branch::$(echo "$PR_JSON" | jq -r .head.ref)"
echo "repo=$(echo "$PR_JSON" | jq -r .head.repo.full_name)" >> $GITHUB_OUTPUT
echo "branch=$(echo "$PR_JSON" | jq -r .head.ref)" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
Expand Down Expand Up @@ -97,7 +94,7 @@ jobs:
- name: Check for changes
id: git-diff
run: |
git diff --quiet && echo "No changes to commit" || echo "::set-output name=changes::true"
git diff --quiet && echo "No changes to commit" || echo "changes=true" >> $GITHUB_OUTPUT
shell: bash

# Commit changes (if any)
Expand Down Expand Up @@ -127,7 +124,7 @@ jobs:
- name: Append success comment (no-op)
uses: peter-evans/create-or-update-comment@v4
if: steps.git-diff.outputs.changes != 'true' && steps.git-diff-2.outputs.changes != 'true'
if: steps.git-diff.outputs.changes != 'true'
with:
comment-id: ${{ steps.first-comment-action.outputs.comment-id }}
reactions: "+1"
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:

workflow_dispatch:

env:
AIRBYTE_ANALYTICS_ID: ${{ vars.AIRBYTE_ANALYTICS_ID }}

jobs:
build:
runs-on: ubuntu-latest
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/python_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
- main
pull_request: {}

env:
AIRBYTE_ANALYTICS_ID: ${{ vars.AIRBYTE_ANALYTICS_ID }}

jobs:
ruff-lint-check:
name: Ruff Lint Check
Expand All @@ -30,7 +27,7 @@ jobs:
run: poetry install --all-extras

# Job-specifc step(s):
- name: Format code
- name: Run lint check
run: poetry run ruff check .

ruff-format-check:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/python_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ on:
- main
pull_request: {}

env:
AIRBYTE_ANALYTICS_ID: ${{ vars.AIRBYTE_ANALYTICS_ID }}

jobs:
pytest-fast:
name: Pytest (Fast)
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/release_drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,11 @@ on:
# pull_request_target:
# types: [opened, reopened, synchronize]

env:
AIRBYTE_ANALYTICS_ID: ${{ vars.AIRBYTE_ANALYTICS_ID }}

permissions:
contents: write
pull-requests: write

jobs:
update_release_draft:
permissions:
contents: write
pull-requests: read
pull-requests: write
runs-on: ubuntu-latest
steps:
# Drafts the next Release notes as Pull Requests are merged into "main"
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/slash_command_dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
issue_comment:
types: [created]

env:
AIRBYTE_ANALYTICS_ID: ${{ vars.AIRBYTE_ANALYTICS_ID }}

jobs:
slashCommandDispatch:
# Only allow slash commands on pull request (not on issues)
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/test-pr-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ on:
type: string
required: false

env:
AIRBYTE_ANALYTICS_ID: ${{ vars.AIRBYTE_ANALYTICS_ID }}

jobs:
start-workflow:
name: Append 'Starting' Comment
Expand All @@ -25,10 +22,10 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
PR_JSON=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.inputs.pr }})
PR_JSON=$(gh api "repos/${{ github.repository }}/pulls/${{ github.event.inputs.pr }}")
echo "$PR_JSON" > pr-info.json
echo "sha=$(cat pr-info.json | jq -r .head.sha)" >> $GITHUB_OUTPUT
echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT
echo "sha=$(jq -r .head.sha < pr-info.json)" >> "$GITHUB_OUTPUT"
echo "run-url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> "$GITHUB_OUTPUT"
- name: Upload PR details as artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -123,15 +120,14 @@ jobs:
- name: Post CI Success to GitHub
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/statuses/$(cat pr-info.json | jq -r .head.sha) \
--url "https://api.github.com/repos/${{ github.repository }}/statuses/$(jq -r .head.sha < pr-info.json)" \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"state": "success",
"context": "Pytest (All, Python ${{ matrix.python-version }}, ${{ matrix.os }})",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
}' \
log-success-comment:
name: Append 'Success' Comment
needs: [pytest-on-demand]
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Node artifacts
node_modules

# Coverage
.coverage

# TODO: these are tmp files generated by unit tests. They should go to the /tmp directory.
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
build
coverage
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"overrides": [
{
"files": "*.md",
"options": {
"proseWrap": "preserve"
}
}
]
}
26 changes: 26 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"prettier": "^3.3.3"
}
}

0 comments on commit f9810f3

Please sign in to comment.