Skip to content

Commit

Permalink
add new ci
Browse files Browse the repository at this point in the history
  • Loading branch information
bcodell committed Oct 29, 2023
1 parent 38a803a commit 4badc33
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 13 deletions.
33 changes: 20 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
name: CI

on:
# Triggers the workflow on push or pull request events but only for the main branch
pull_request:
branches: [ main ]

workflow_call:
inputs:
target:
type: string
required: true
gcp_keyfile_path:
type: string
required: true

jobs:
build:
ci:
runs-on: ubuntu-latest
env:
DBT_PROFILES_DIR: . # Use integration_tests/profiles.yml

steps:
- name: Checkout Branch
uses: actions/checkout@v2
- name: Build dbt Integration Tests Project
with:
target: ${{ inputs.target }}
env:
GCP_KEYFILE_PATH: ${{ inputs.gcp_keyfile_path }}
DBT_PROFILES_DIR: . # Use integration_tests/profiles.yml
run: |
cd ./integration_tests
dbt build -x --target ${{ inputs.target }}


- name: CI in Dockerfile
uses: ./.github/actions/run_ci
25 changes: 25 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI - Pull Request
on:
pull_request:
branches: [ main ]

jobs:
setup:
uses: ./.github/workflows/setup.yml
secrets:
gcp_keyfile: ${{ secrets.GCP_KEYFILE }}
gcp_keyfile_path: ./integration_tests/gcp_keyfile.json

duckdb:
needs: [ setup ]
uses: ./.github/workflows/ci.yml
with:
target: bigquery
gcp_keyfile_path: ./integration_tests/gcp_keyfile.json

bigquery:
needs: [ setup ]
uses: ./.github/workflows/ci.yml
with:
target: bigquery
gcp_keyfile_path: ./integration_tests/gcp_keyfile.json
40 changes: 40 additions & 0 deletions .github/workflows/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Setup
on:
workflow_call:
inputs:
target:
type: string
required: true
gcp_keyfile_path:
type: string
required: true
secrets:
gcp_keyfile:
required: true

jobs:
setup:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
env:
GCP_KEYFILE: ${{ secrets.gcp_keyfile }}

steps:
- name: Checkout Branch
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python -
- name: Install Python Dependencies
run: poetry install --no-interaction
- name: Publish GCP Keyfile
run: echo $GCP_KEYFILE > ${{ inputs.gcp_keyfile_path }}
- name: dbt deps
run: |
cd ./integration_tests
dbt deps

0 comments on commit 4badc33

Please sign in to comment.