Skip to content

Commit

Permalink
commit changes to break into separate prs
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Apr 22, 2024
1 parent c30dd66 commit 2944b5e
Show file tree
Hide file tree
Showing 13 changed files with 157 additions and 372 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ on:
- labeled

permissions:

pull-requests: write# to create the PR
pull-requests: write # to create the PR
contents: write # to create the comment if the process fails

jobs:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/bot-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# - create a `changie` entry for automated PRs using this template:
#
# kind: <per action matrix> (e.g. Dependencies)
# body: <PR title>
# time: <current timestamp>
# custom:
# Author: <PR User Login (generally the bot)>
# PR: <PR number>
# body: <PR title>
# time: <current timestamp>
# custom:
# Author: <PR User Login (generally the bot)>
# PR: <PR number>
#
# **why?**
# - automate and standardize `changie` entry generation for automated PRs
Expand Down
61 changes: 0 additions & 61 deletions .github/workflows/build-artifacts.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/clean-repo.yml

This file was deleted.

86 changes: 0 additions & 86 deletions .github/workflows/code-quality.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
name: "Integration tests"
name: "Dev branch integration tests"

on:
pull_request_target:
push:
branches:
- "main"
- "*.latest"
workflow_call:
inputs:
branch:
description: "The branch/tag to run integration tests on"
type: string
default: "main"
dbt-adapters-branch:
description: "The branch/tag of `dbt-adapters` to use"
type: string
default: "main"
dbt-common-branch:
description: "The branch/tag of `dbt-common` to use"
type: string
default: "main"
dbt-core-branch:
description: "The branch/tag of `dbt-core` to use"
type: string
default: "main"
workflow_dispatch:
inputs:
branch:
Expand All @@ -46,7 +23,7 @@ on:
permissions: read-all

concurrency:
group: "${{ github.workflow }}-${{ github.event_name }}-${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.ref || github.sha }}"
group: "${{ github.workflow }}-${{ github.event_name }}-${{ github.sha }}"
cancel-in-progress: true

jobs:
Expand All @@ -67,7 +44,7 @@ jobs:
with:
msg: |
"Thanks for your contribution! "\
"Since this is a fork, integration tests need to be approved prior to running. "\
"This PR was created from a fork, integration tests need to be approved prior to running. "\
"@dbt-labs/core will review this PR and approve running integration tests."
check_for_duplicate_msg: true

Expand Down Expand Up @@ -115,7 +92,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: "Setup environment"
uses: dbt-labs/dbt-adapters/.github/actions/setup-environment@update-workflows
uses: dbt-labs/actions/setup-environment@add-hatch-actions
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -132,14 +109,28 @@ jobs:
run: hatch run integration-tests:all

aggregate-results:
name: "Successful integration tests"
name: "Collect integration tests results"
needs: integration-tests
if: ${{ !failure() && !cancelled() }}
if: always() && !cancelled()
runs-on: ubuntu-latest
steps:
- name: "Integration tests completed successfully"
- name: "[INFO] Integration tests - FAILED"
if: failure()
shell: bash
run: |
title="Integration tests"
message="Integration tests completed successfully!"
echo "::notice title=${{ env.NOTIFICATION_PREFIX }}: $title::$message"
echo "::notice title=[$WORKFLOW]: $TITLE::$MESSAGE"
exit 1
env:
WORKFLOW: ${{ env.NOTIFICATION_PREFIX }}
TITLE: "Integration tests - FAILED"
MESSAGE: "Integration tests failed!"

- name: "[INFO] Integration tests - PASSED"
if: ${{ !failure() }} # includes skipped
shell: bash
run: |
echo "::notice title=[$WORKFLOW]: $TITLE::$MESSAGE"
env:
WORKFLOW: ${{ env.NOTIFICATION_PREFIX }}
TITLE: "Integration tests - PASSED"
MESSAGE: "Integration tests completed successfully!"
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# - labels are updated on the PR
# - new code is pushed to the branch
# The action will get skipped if the 'Skip Changelog' label is present.
name: Check Changelog Entry
name: "Changelog check"

on:
pull_request:
Expand All @@ -26,7 +26,6 @@ on:
- labeled
- unlabeled
- synchronize
workflow_dispatch:

defaults:
run:
Expand All @@ -42,5 +41,4 @@ jobs:
with:
changelog_comment: "Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the [dbt-redshift contributing guide](https://github.com/dbt-labs/dbt-redshift/blob/main/CONTRIBUTING.md)."
skip_label: "Skip Changelog"
# this is only acceptable because we own the action we're calling
secrets: inherit
44 changes: 44 additions & 0 deletions .github/workflows/pull-request-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Pull request checks"

on:
pull_request_target:
types:
- opened
- synchronize

permissions: read-all

concurrency:
group: "${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.head.ref }}"
cancel-in-progress: true

jobs:
code-quality:
name: "Run code quality"
uses: dbt-labs/actions/.github/workflows/code-quality.yml
with:
ref: ${{ github.event.pull_request.head.ref }}
check-command: "hatch run code-quality"
python-version: ${{ vars.DBT_TEST_PYTHON_VERSION }}

unit-tests:
name: "Run unit tests"
uses: dbt-labs/actions/.github/workflows/unit-tests.yml
with:
ref: ${{ github.event.pull_request.head.ref }}
test-command: "hatch run unit-tests:all"
python-versions: ${{ vars.DBT_TEST_PYTHON_ALL_VERSIONS }}

integration-tests:
name: "Run unit tests"
uses: dbt-labs/actions/.github/workflows/integration-tests.yml
with:
ref: ${{ github.event.pull_request.head.ref }}
test-command: "hatch run integration-tests:all"
python-versions-ubuntu: ${{ vars.DBT_TEST_PYTHON_ALL_VERSIONS }}
python-versions-macos: ${{ vars.DBT_TEST_PYTHON_VERSION }}
python-versions-windows: ${{ vars.DBT_TEST_PYTHON_VERSION }}

verify-build-artifacts:
name: "Verify build artifacts"
uses: dbt-labs/actions/.github/workflows/build-artifacts.yml@add-hatch-actions
Loading

0 comments on commit 2944b5e

Please sign in to comment.