From fd02b4e95cf06116b50af338705f22580e933930 Mon Sep 17 00:00:00 2001 From: Padraic Slattery Date: Mon, 9 Dec 2024 21:08:10 +0100 Subject: [PATCH] Moving dbt commands to retrying make command --- .github/workflows/ci_pipeline.yml | 7 ++----- .github/workflows/dbt_artifact_probes.yml | 5 +---- .github/workflows/merge_pipeline.yml | 10 ++-------- .github/workflows/post_release_pipeline.yml | 5 +---- makefile | 7 +++++++ 5 files changed, 13 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci_pipeline.yml b/.github/workflows/ci_pipeline.yml index 944766aa..87a17b10 100644 --- a/.github/workflows/ci_pipeline.yml +++ b/.github/workflows/ci_pipeline.yml @@ -2,7 +2,7 @@ name: CI pipeline on: - pull_request_target: + pull_request: # _target: branches: - main @@ -108,10 +108,7 @@ jobs: if: matrix.operating-system == 'windows-latest' run: | $env:Path += ';C:\Users\runneradmin\.local\bin' - poetry run dbt deps - poetry run dbt build - poetry run dbt docs generate - poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml + (r=3;while ! make build-and-run-dbt-bouncer ; do ((--r))||exit;done) - name: Regenerate dbt artifacts and run `dbt-bouncer` if: matrix.operating-system != 'windows-latest' diff --git a/.github/workflows/dbt_artifact_probes.yml b/.github/workflows/dbt_artifact_probes.yml index 27da9dfd..3bf59d80 100644 --- a/.github/workflows/dbt_artifact_probes.yml +++ b/.github/workflows/dbt_artifact_probes.yml @@ -66,7 +66,4 @@ - name: Regenerate dbt artifacts and run `dbt-bouncer` run: | - poetry run dbt deps - poetry run dbt build - poetry run dbt docs generate - poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml + (r=3;while ! make build-and-run-dbt-bouncer ; do ((--r))||exit;done) diff --git a/.github/workflows/merge_pipeline.yml b/.github/workflows/merge_pipeline.yml index 41abaa67..d24e1fd2 100644 --- a/.github/workflows/merge_pipeline.yml +++ b/.github/workflows/merge_pipeline.yml @@ -157,15 +157,9 @@ if: matrix.operating-system == 'windows-latest' run: | $env:Path += ';C:\Users\runneradmin\.local\bin' - poetry run dbt deps - poetry run dbt build - poetry run dbt docs generate - poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml + make build-and-run-dbt-bouncer - name: Regenerate dbt artifacts and run `dbt-bouncer` if: matrix.operating-system != 'windows-latest' run: | - poetry run dbt deps - poetry run dbt build - poetry run dbt docs generate - poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml + (r=3;while ! make build-and-run-dbt-bouncer ; do ((--r))||exit;done) diff --git a/.github/workflows/post_release_pipeline.yml b/.github/workflows/post_release_pipeline.yml index 3568ab20..9ef187ce 100644 --- a/.github/workflows/post_release_pipeline.yml +++ b/.github/workflows/post_release_pipeline.yml @@ -127,7 +127,4 @@ jobs: - name: Regenerate dbt artifacts and run `dbt-bouncer` if: matrix.operating-system != 'windows-latest' run: | - poetry run dbt deps - poetry run dbt build - poetry run dbt docs generate - poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml + (r=3;while ! make build-and-run-dbt-bouncer ; do ((--r))||exit;done) diff --git a/makefile b/makefile index 2d00f675..cabdacc7 100644 --- a/makefile +++ b/makefile @@ -1,3 +1,10 @@ +# On GitHub the `dbt build` command often returns "leaked semaphores" errors. +build-and-run-dbt-bouncer: + poetry run dbt deps + poetry run dbt build + poetry run dbt docs generate + poetry run dbt-bouncer --config-file ./dbt-bouncer-example.yml + build-artifacts: poetry run python ./scripts/generate_artifacts.py