MM-56193: migrate dags to airflow 2 (#1406) #165
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: Python Tests | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/ci-python.yml' | |
- 'build/Dockerfile' | |
- 'extract/**' | |
- 'tests/**' | |
- 'utils/**' | |
- 'poetry.lock' | |
- 'pyproject.toml' | |
pull_request: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/ci-python.yml' | |
- 'build/Dockerfile' | |
- 'extract/**' | |
- 'tests/**' | |
- 'utils/**' | |
- 'poetry.lock' | |
- 'pyproject.toml' | |
jobs: | |
tests: | |
name: ${{ matrix.name }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { name: '3.10', python: '3.10' } | |
- { name: '3.7', python: '3.7' } | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Install Poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v4 | |
id: setup-python | |
with: | |
python-version: ${{ matrix.python }} | |
cache: 'poetry' | |
- name: Install dependencies | |
run: poetry install && poetry run pip install clearbit==0.1.7 | |
- name: Run tests | |
run: poetry run pytest --cov | |
docker: | |
name: Build docker image | |
runs-on: ubuntu-latest | |
needs: tests | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Lint docker image | |
run: make docker-lint | |
- name: Build & push docker image | |
run: make docker-login && make docker-build && make docker-push | |
env: | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Sign docker image | |
run: make docker-sign && make docker-verify | |
env: | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
COSIGN_KEY: ${{ secrets.COSIGN_KEY }} | |
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} | |
COSIGN_PUBLIC_KEY: ${{ secrets.COSIGN_PUBLIC_KEY }} |