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

ci improvements #1159

Merged
merged 26 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5bda072
remove matrix stuff and point destination tests to essential
sh-rp Mar 28, 2024
190fd2f
mark one test as essential and switch destination tests to run essent…
sh-rp Mar 28, 2024
053ea3a
add prefixes to workflow files
sh-rp Mar 28, 2024
7851ec2
unify naming a bit more
sh-rp Mar 28, 2024
25b5edb
update snippets
sh-rp Mar 28, 2024
ddf55ad
increase time difference value in gdrive tests
sh-rp Mar 28, 2024
b227c60
allow workflows to run on forks if so labelled
sh-rp Apr 2, 2024
bd141d8
remove secrets from local destinations tests
sh-rp Apr 2, 2024
4adba77
guard secrets leaking on docs tests
sh-rp Apr 2, 2024
a0efc88
update job output
sh-rp Apr 2, 2024
bea8029
test label on bigquery
sh-rp Apr 2, 2024
1d6777b
force rerun
sh-rp Apr 2, 2024
2668e0a
put secrets back in local destinations
sh-rp Apr 2, 2024
48dc15a
add new run setup to all destinations
sh-rp Apr 2, 2024
d59a778
mark a couple of tests as essential
sh-rp Apr 2, 2024
6b51a3f
add nightly schedule for full destination test run
sh-rp Apr 2, 2024
9d634cd
fix tests condition
sh-rp Apr 2, 2024
cd9415b
fix type
sh-rp Apr 3, 2024
9b08e8c
add a bunch of more essential markers
sh-rp Apr 3, 2024
d7de408
run full tests on mssql for all branches
sh-rp Apr 3, 2024
f3eba6b
fix newlines in yaml file
sh-rp Apr 3, 2024
c19ca85
Merge branch 'devel' into d#/ci_improvements
sh-rp Apr 3, 2024
d2c0c6e
register essential marker and remove some essential tests
sh-rp Apr 4, 2024
65c754d
exclude \"athena-parquet-staging-iceberg\" from regular athena tests
sh-rp Apr 4, 2024
a461d9c
remove regular athena tests from iceberg tests
sh-rp Apr 4, 2024
02aea29
Merge branch 'devel' into d#/ci_improvements
rudolfix Apr 7, 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
2 changes: 1 addition & 1 deletion .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: deploy docs
name: docs | deploy docs

on:
schedule:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/get_docs_changes.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: get docs changes
name: util | get docs changes

on:
workflow_call:
Expand All @@ -13,6 +13,7 @@ env:

jobs:
get_docs_changes:
name: docs changes
runs-on: ubuntu-latest
outputs:
changes_outside_docs: ${{ steps.check_changes.outputs.changes_outside_docs }}
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: lint
name: lint | code & tests

on:
pull_request:
Expand All @@ -14,10 +14,11 @@ concurrency:

jobs:
get_docs_changes:
name: docs changes
uses: ./.github/workflows/get_docs_changes.yml

run_lint:
name: Lint
name: lint
needs: get_docs_changes
if: needs.get_docs_changes.outputs.changes_outside_docs == 'true'
strategy:
Expand Down Expand Up @@ -65,12 +66,6 @@ jobs:
export PATH=$PATH:"/c/Program Files/usr/bin" # needed for Windows
make lint

# - name: print envs
# run: |
# echo "The GitHub Actor's username is: $GITHUB_ACTOR"
# echo "The GitHub repo owner is: $GITHUB_REPOSITORY_OWNER"
# echo "The GitHub repo is: $GITHUB_REPOSITORY"

matrix_job_required_check:
name: Lint results
needs: run_lint
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test_airflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test airflow integration
name: tools | airflow

on:
pull_request:
Expand All @@ -13,10 +13,11 @@ concurrency:

jobs:
get_docs_changes:
name: docs changes
uses: ./.github/workflows/get_docs_changes.yml

run_airflow:
name: Tests Airflow integration
name: test
needs: get_docs_changes
if: needs.get_docs_changes.outputs.changes_outside_docs == 'true'
runs-on: ubuntu-latest
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test_build_images.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test build docker images
name: tools | docker images

on:
pull_request:
Expand All @@ -13,10 +13,11 @@ concurrency:

jobs:
get_docs_changes:
name: docs changes
uses: ./.github/workflows/get_docs_changes.yml

run_airflow:
name: Build alpine and airflow images
name: build
needs: get_docs_changes
if: needs.get_docs_changes.outputs.changes_outside_docs == 'true'
runs-on: ubuntu-latest
Expand All @@ -38,4 +39,4 @@ jobs:
installer-parallel: true

- name: Build images
run: make test-build-images
run: make test-build-images
5 changes: 3 additions & 2 deletions .github/workflows/test_common.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test common
name: common | common

sultaniman marked this conversation as resolved.
Show resolved Hide resolved
on:
pull_request:
Expand All @@ -16,10 +16,11 @@ env:

jobs:
get_docs_changes:
name: docs changes
uses: ./.github/workflows/get_docs_changes.yml

run_common:
name: Tests common dlt code
name: test
needs: get_docs_changes
if: needs.get_docs_changes.outputs.changes_outside_docs == 'true'
strategy:
Expand Down
31 changes: 5 additions & 26 deletions .github/workflows/test_dbt_cloud.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: test dbt cloud
name: tools | dbt cloud

on:
pull_request:
Expand All @@ -22,22 +22,18 @@ env:

jobs:
get_docs_changes:
name: docs changes
uses: ./.github/workflows/get_docs_changes.yml
if: ${{ !github.event.pull_request.head.repo.fork }}
if: ${{ !github.event.pull_request.head.repo.fork || contains(github.event.pull_request.labels.*.name, 'ci from fork')}}

run_dbt_cloud:
name: Tests dbt cloud
name: test
needs: get_docs_changes
if: needs.get_docs_changes.outputs.changes_outside_docs == 'true'
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
# os: ["ubuntu-latest", "macos-latest", "windows-latest"]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
runs-on: "ubuntu-latest"

steps:

Expand Down Expand Up @@ -70,21 +66,4 @@ jobs:

- run: |
poetry run pytest tests/helpers/dbt_cloud_tests -k '(not venv)'
if: runner.os != 'Windows'
name: Run dbt cloud - Linux/MAC
- run: |
poetry run pytest tests/helpers/dbt_cloud_tests -k "(not venv)"
if: runner.os == 'Windows'
name: Run dbt cloud - Windows
shell: cmd

matrix_job_required_check:
name: dbt cloud tests
needs: run_dbt_cloud
runs-on: ubuntu-latest
if: always()
steps:
- name: Check matrix job results
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One or more matrix job tests failed or were cancelled. You may need to re-run them." && exit 1
31 changes: 5 additions & 26 deletions .github/workflows/test_dbt_runner.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: test dbt runner
name: tools | dbt runner

on:
pull_request:
Expand All @@ -19,22 +19,18 @@ env:

jobs:
get_docs_changes:
name: docs changes
uses: ./.github/workflows/get_docs_changes.yml
if: ${{ !github.event.pull_request.head.repo.fork }}
if: ${{ !github.event.pull_request.head.repo.fork || contains(github.event.pull_request.labels.*.name, 'ci from fork')}}

run_dbt:
name: Tests dbt runner
name: test
needs: get_docs_changes
if: needs.get_docs_changes.outputs.changes_outside_docs == 'true'
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
# os: ["ubuntu-latest", "macos-latest", "windows-latest"]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
runs-on: "ubuntu-latest"

steps:

Expand Down Expand Up @@ -84,21 +80,4 @@ jobs:

- run: |
poetry run pytest tests/helpers/dbt_tests --ignore=tests/helpers/dbt_tests/local -k '(not local)'
if: runner.os != 'Windows'
name: Run dbt runner with venv - Linux/MAC
- run: |
poetry run pytest tests/helpers/dbt_tests --ignore=tests/helpers/dbt_tests/local -m "not forked" -k "(not local)"
if: runner.os == 'Windows'
name: Run dbt runner with venv - Windows
shell: cmd

matrix_job_required_check:
name: dbt runner tests
needs: run_dbt
runs-on: ubuntu-latest
if: always()
steps:
- name: Check matrix job results
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One or more matrix job tests failed or were cancelled. You may need to re-run them." && exit 1
41 changes: 14 additions & 27 deletions .github/workflows/test_destination_athena.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@

name: test athena
name: dest | athena

on:
pull_request:
branches:
- master
- devel
workflow_dispatch:
schedule:
- cron: '0 2 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -20,27 +22,23 @@ env:
RUNTIME__DLTHUB_TELEMETRY_SEGMENT_WRITE_KEY: TLJiyRkGVZGCi2TtjClamXpFcxAA1rSB
ACTIVE_DESTINATIONS: "[\"athena\"]"
ALL_FILESYSTEM_DRIVERS: "[\"memory\"]"
EXCLUDED_DESTINATION_CONFIGURATIONS: "[\"athena-parquet-staging-iceberg\"]"
EXCLUDED_DESTINATION_CONFIGURATIONS: "[\"athena-parquet-staging-iceberg\", \"athena-parquet-no-staging-iceberg\"]"

jobs:
get_docs_changes:
name: docs changes
uses: ./.github/workflows/get_docs_changes.yml
# Tests that require credentials do not run in forks
if: ${{ !github.event.pull_request.head.repo.fork }}
if: ${{ !github.event.pull_request.head.repo.fork || contains(github.event.pull_request.labels.*.name, 'ci from fork')}}

run_loader:
name: test destination athena
name: test
needs: get_docs_changes
if: needs.get_docs_changes.outputs.changes_outside_docs == 'true'
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
# os: ["ubuntu-latest", "macos-latest", "windows-latest"]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
runs-on: "ubuntu-latest"

steps:

Expand Down Expand Up @@ -75,22 +73,11 @@ jobs:
run: pwd && echo "$DLT_SECRETS_TOML" > tests/.dlt/secrets.toml

- run: |
poetry run pytest tests/load
if: runner.os != 'Windows'
name: Run tests Linux/MAC
poetry run pytest tests/load -m "essential"
name: Run essential tests Linux
if: ${{ ! (contains(github.event.pull_request.labels.*.name, 'ci full') || !github.event_name == 'schedule')}}

- run: |
poetry run pytest tests/load
if: runner.os == 'Windows'
name: Run tests Windows
shell: cmd

matrix_job_required_check:
name: Redshift, PostgreSQL and DuckDB tests
needs: run_loader
runs-on: ubuntu-latest
if: always()
steps:
- name: Check matrix job results
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One or more matrix job tests failed or were cancelled. You may need to re-run them." && exit 1
name: Run all tests Linux
if: ${{ contains(github.event.pull_request.labels.*.name, 'ci full') || github.event_name == 'schedule'}}
41 changes: 14 additions & 27 deletions .github/workflows/test_destination_athena_iceberg.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@

name: test athena iceberg
name: dest | athena iceberg

on:
pull_request:
branches:
- master
- devel
workflow_dispatch:
schedule:
- cron: '0 2 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -20,27 +22,23 @@ env:
RUNTIME__DLTHUB_TELEMETRY_SEGMENT_WRITE_KEY: TLJiyRkGVZGCi2TtjClamXpFcxAA1rSB
ACTIVE_DESTINATIONS: "[\"athena\"]"
ALL_FILESYSTEM_DRIVERS: "[\"memory\"]"
EXCLUDED_DESTINATION_CONFIGURATIONS: "[\"athena-no-staging\"]"
EXCLUDED_DESTINATION_CONFIGURATIONS: "[\"athena-no-staging\", \"athena-parquet-no-staging\"]"

jobs:
get_docs_changes:
name: docs changes
uses: ./.github/workflows/get_docs_changes.yml
# Tests that require credentials do not run in forks
if: ${{ !github.event.pull_request.head.repo.fork }}
if: ${{ !github.event.pull_request.head.repo.fork || contains(github.event.pull_request.labels.*.name, 'ci from fork')}}

run_loader:
name: test destination athena iceberg
name: test
needs: get_docs_changes
if: needs.get_docs_changes.outputs.changes_outside_docs == 'true'
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
# os: ["ubuntu-latest", "macos-latest", "windows-latest"]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
runs-on: "ubuntu-latest"

steps:

Expand Down Expand Up @@ -75,22 +73,11 @@ jobs:
run: pwd && echo "$DLT_SECRETS_TOML" > tests/.dlt/secrets.toml

- run: |
poetry run pytest tests/load
if: runner.os != 'Windows'
name: Run tests Linux/MAC
poetry run pytest tests/load -m "essential"
name: Run essential tests Linux
if: ${{ ! (contains(github.event.pull_request.labels.*.name, 'ci full') || github.event_name == 'schedule')}}

- run: |
poetry run pytest tests/load
if: runner.os == 'Windows'
name: Run tests Windows
shell: cmd

matrix_job_required_check:
name: Redshift, PostgreSQL and DuckDB tests
needs: run_loader
runs-on: ubuntu-latest
if: always()
steps:
- name: Check matrix job results
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One or more matrix job tests failed or were cancelled. You may need to re-run them." && exit 1
name: Run all tests Linux
if: ${{ contains(github.event.pull_request.labels.*.name, 'ci full') || github.event_name == 'schedule'}}
Loading
Loading