From 1b4b7ea8b539023945df83aa39749580053549b5 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 9 Oct 2024 15:46:30 -0400 Subject: [PATCH] remove formatting diffs for a more readable PR --- .github/workflows/ci.yml | 39 +++++-------------- .../workflows/functional-tests-workflow.yml | 11 +++--- .github/workflows/functional-tests.yml | 4 ++ dbt-athena/tests/unit/__init__.py | 0 4 files changed, 19 insertions(+), 35 deletions(-) delete mode 100644 dbt-athena/tests/unit/__init__.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98b74e3f..557d7ba3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,57 +1,36 @@ -name: "CI" +name: ci run-name: "CI - ${{ github.event_name }} - ${{ github.actor }}" on: pull_request: push: branches: [main] - workflow_dispatch: - inputs: - branch: - description: "The branch to run CI against" - type: string - default: "main" jobs: - code-quality: - name: "Pre-commit checks" + pre-commit: + name: 'Pre-commit checks' runs-on: ubuntu-latest steps: - - name: "Checkout repo - PR" - if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} - uses: actions/checkout@v3 - - name: "Checkout repo - Dispatch" - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/checkout@v3 - with: - ref: ${{ inputs.branch }} + - uses: actions/checkout@v3 - name: "Setup `hatch`" uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main with: python-version: '3.11' - - name: "Run code quality" - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@v3.0.0 - unit-tests: - name: "Unit tests" + unit_test: + name: 'Unit tests with coverage' runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - - name: "Checkout repo - PR" - if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} - uses: actions/checkout@v3 - - name: "Checkout repo - Dispatch" - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/checkout@v3 - with: - ref: ${{ inputs.branch }} + - uses: actions/checkout@v3 - name: "Setup `hatch`" uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main with: python-version: ${{ matrix.python-version }} - - name: "Run unit tests" + - name: Test with pytest run: hatch run unit-tests working-directory: ./dbt-athena diff --git a/.github/workflows/functional-tests-workflow.yml b/.github/workflows/functional-tests-workflow.yml index 3fc9ad91..a4e9b9b2 100644 --- a/.github/workflows/functional-tests-workflow.yml +++ b/.github/workflows/functional-tests-workflow.yml @@ -8,6 +8,9 @@ on: checkout-ref: required: true type: string + checkout-repository: + required: true + type: string concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.ref || github.sha }} cancel-in-progress: true @@ -33,18 +36,16 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ inputs.checkout-ref }} - + repository: ${{ inputs.checkout-repository }} - name: "Setup `hatch`" uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main with: python-version: ${{ matrix.python-version }} - - - name: "Configure AWS credentials from Test account" + - name: Configure AWS credentials from Test account uses: aws-actions/configure-aws-credentials@v2 with: role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.ASSUMABLE_ROLE_NAME }} aws-region: ${{ vars.DBT_TEST_ATHENA_REGION_NAME }} - - - name: "Functional Test" + - name: Functional Test run: hatch run integration-tests working-directory: ./dbt-athena diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index 965d661c..1fbe12f2 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -12,6 +12,9 @@ on: checkout-ref: required: true type: string + checkout-repository: + required: true + type: string jobs: # workflow that is invoked when for PRs with labels 'enable-functional-tests' @@ -40,3 +43,4 @@ jobs: contents: read with: checkout-ref: ${{ github.ref }} + checkout-repository: ${{ github.event.pull_request.head.repo.full_name }} diff --git a/dbt-athena/tests/unit/__init__.py b/dbt-athena/tests/unit/__init__.py deleted file mode 100644 index e69de29b..00000000