Skip to content

comment python model #357

comment python model

comment python model #357

Workflow file for this run

name: 🔮 CI
on:
push
jobs:
build:
runs-on: ubuntu-latest
env:
CI: 1
PYTHONPATH: .
PGPASSWORD: password
PGHOST: localhost
PGUSER: postgres
PGPORT: 5432
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
services:
postgres:
image: postgis/postgis:14-master
env:
POSTGRES_PASSWORD: password
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: 🐘 Non-durable PostgreSQL
run: |
psql <<SQL
ALTER SYSTEM SET fsync=off;
ALTER SYSTEM SET synchronous_commit=off;
ALTER SYSTEM SET full_page_writes=off;
CREATE DATABASE pilotage;
CREATE DATABASE airflow;
SQL
docker kill --signal=SIGHUP ${{ job.services.postgres.id }}
- uses: actions/checkout@v3.5.0
- name: 🐍 Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
cache-dependency-path: requirements-ci.txt
- name: 📥 Install Python dependencies
run: |
make venv_ci
echo ".venv/bin" >> $GITHUB_PATH
- name: ⚙ Setup airflow database
run: make airflow_initdb
env:
AIRFLOW__CORE__FERNET_KEY: U7sOUkZeQ6JGmwQoG6anMTdnl_nzy4f74IFkNmMeW50=
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql://postgres:password@localhost:5432/airflow
- name: Install dbt packages
run: dbt deps
- name: ✨ Lint with black, isort, flake8 & sqlfluff 👌
run: make quality
env:
PGDATABASE: pilotage
- name: 🧪 Run airflow tests
run: make test
env:
PGDATABASE: pilotage
AIRFLOW__CORE__FERNET_KEY: U7sOUkZeQ6JGmwQoG6anMTdnl_nzy4f74IFkNmMeW50=
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql://postgres:password@localhost:5432/airflow
- name: 📓 Generate dbt documentation
run: make dbt_docs
env:
PGDATABASE: pilotage