Update dbt.py #20
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ghcr.io/${{ github.repository }}-devcontainer | |
CONNECTIONS_FILE: ./config/connections.json | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
env: | |
CI: true | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Load Airflow connections | |
env: | |
AIRFLOW_CONNECTIONS: ${{ secrets.AIRFLOW_CONNECTIONS }} | |
run: | | |
echo "$AIRFLOW_CONNECTIONS" > ${{ env.CONNECTIONS_FILE }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pre-build dev container image | |
uses: devcontainers/[email protected] | |
with: | |
imageName: ${{ env.IMAGE_NAME }} | |
cacheFrom: ${{ env.IMAGE_NAME }} | |
push: always | |
- name: Build container and run pre-commit format and lint | |
uses: devcontainers/[email protected] | |
continue-on-error: true | |
with: | |
imageName: ${{ env.IMAGE_NAME }} | |
cacheFrom: ${{ env.IMAGE_NAME }} | |
# Run pre-commit checks | |
runCmd: | | |
pre-commit run --all-files --verbose --show-diff-on-failure | |
- name: Build container and run unit tests | |
uses: devcontainers/[email protected] | |
with: | |
imageName: ${{ env.IMAGE_NAME }} | |
cacheFrom: ${{ env.IMAGE_NAME }} | |
# Run unit tests | |
runCmd: | | |
script/test | |
- name: Cleanup Files | |
if: always() | |
run: | | |
rm -f ${{ env.CONNECTIONS_FILE }} |