diff --git a/.github/workflows/dbt_integration_test.yml b/.github/workflows/dbt_integration_test.yml new file mode 100644 index 0000000..1646d61 --- /dev/null +++ b/.github/workflows/dbt_integration_test.yml @@ -0,0 +1,17 @@ +name: dbt_run_integration_test +run-name: ${{ github.event.inputs.branch }} + +on: + workflow_dispatch: + +concurrency: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt.yml@main + with: + command: > + dbt test --selector 'integration_tests' + environment: ${{ github.ref == 'refs/heads/main' && 'workflow_prod' || 'workflow_dev' }} + warehouse: ${{ vars.WAREHOUSE }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_deployment.yml b/.github/workflows/dbt_run_deployment.yml deleted file mode 100644 index f69e52b..0000000 --- a/.github/workflows/dbt_run_deployment.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: dbt_run_deployment -run-name: dbt_run_deployment - -on: - workflow_dispatch: - branches: - - "main" - inputs: - warehouse: - type: choice - description: Snowflake warehouse - required: true - options: - - DBT - - DBT_CLOUD - - DBT_EMERGENCY - default: DBT - dbt_command: - type: string - description: 'DBT Run Command' - required: true - -env: - USE_VARS: "${{ vars.USE_VARS }}" - DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}" - DBT_VERSION: "${{ vars.DBT_VERSION }}" - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ inputs.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - called_workflow_template: - uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt_run_deployment_template.yml@AN-4374/upgrade-dbt-1.7 - with: - dbt_command: | - ${{ inputs.dbt_command }} - environment: workflow_prod - warehouse: ${{ inputs.WAREHOUSE }} - secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_non_core.yml b/.github/workflows/dbt_run_non_core.yml deleted file mode 100644 index b73199a..0000000 --- a/.github/workflows/dbt_run_non_core.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: dbt_run_non_core -run-name: dbt_run_non_core - -on: - workflow_dispatch: - # schedule: - # # Runs "at minute 7 and 37, every hour" (see https://crontab.guru) - # - cron: '10 * * * *' - -env: - USE_VARS: "${{ vars.USE_VARS }}" - DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}" - DBT_VERSION: "${{ vars.DBT_VERSION }}" - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "${{ vars.PYTHON_VERSION }}" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run -m "aleo_models,tag:noncore" diff --git a/.github/workflows/dbt_test_recent.yml b/.github/workflows/dbt_test_recent.yml deleted file mode 100644 index 1be646c..0000000 --- a/.github/workflows/dbt_test_recent.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: dbt_test_recent -run-name: dbt_test_recent - -on: - workflow_dispatch: - # schedule: - # # Daily at 8:30am UTC - # - cron: '30 8 * * *' - -env: - USE_VARS: "${{ vars.USE_VARS }}" - DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}" - DBT_VERSION: "${{ vars.DBT_VERSION }}" - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "${{ vars.PYTHON_VERSION }}" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run -m "aleo_models,tag:recent_test" - dbt test -m "aleo_models,tag:recent_test" \ No newline at end of file diff --git a/data/github_actions__workflows.csv b/data/github_actions__workflows.csv index b0edfc4..ec08fac 100644 --- a/data/github_actions__workflows.csv +++ b/data/github_actions__workflows.csv @@ -1,6 +1,4 @@ workflow_name,workflow_schedule dbt_run_streamline_blocks_realtime,"5,35 * * * *" dbt_run_core,"20,50 * * * *" -dbt_run_non_core,"30,50 * * * *" -dbt_test_recent,"20 */4 * * *" dbt_test_tasks,"0,30 * * * *" \ No newline at end of file diff --git a/selectors.yml b/selectors.yml new file mode 100644 index 0000000..4561b77 --- /dev/null +++ b/selectors.yml @@ -0,0 +1,8 @@ +selectors: + - name: integration_tests + description: "Selector for integration tests" + definition: + union: + - method: fqn + value: "livequery_models.deploy.core.*" + \ No newline at end of file