Fixed rename with just one column #260
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: DBT Automation Package | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
tests: | |
env: | |
TEST_PG_DBHOST: ${{ secrets.TEST_PG_DBHOST }} | |
TEST_PG_DBPORT: ${{ secrets.TEST_PG_DBPORT }} | |
TEST_PG_DBUSER: ${{ secrets.TEST_PG_DBUSER }} | |
TEST_PG_DBPASSWORD: ${{ secrets.TEST_PG_DBPASSWORD }} | |
TEST_PG_DBNAME: ${{ secrets.TEST_PG_DBNAME }} | |
TEST_PG_DBSCHEMA_SRC: ${{ secrets.TEST_PG_DBSCHEMA_SRC }} | |
TEST_BG_SERVICEJSON: ${{ secrets.TEST_BG_SERVICEJSON }} | |
TEST_BG_LOCATION: ${{ secrets.TEST_BG_LOCATION }} | |
TEST_BG_DATASET_SRC: ${{ secrets.TEST_BG_DATASET_SRC }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Create known_hosts file | |
run: | | |
mkdir -p ~/.ssh | |
touch ~/.ssh/known_hosts | |
- name: Add remote host key to known_hosts | |
run: ssh-keyscan ${{ secrets.SSH_SERVERIP }} >> ~/.ssh/known_hosts | |
- name: Login to the jump server and port forward to connect to the postgres warehouse | |
run: | | |
eval `ssh-agent -s` | |
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" | |
ssh -L 5432:${{ secrets.SSH_HOST }}:5432 -f -N ddp@${{ secrets.SSH_SERVERIP }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
python setup.py install | |
- name: Seed data in test warehouse | |
run: | | |
python seeds/seed.py --warehouse postgres | |
python seeds/seed.py --warehouse bigquery | |
- name: Run tests and collect coverage | |
run: | | |
pytest -s --cov=. | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
verbose: true |