burnham/.circleci/config.yml

79 строки
2.1 KiB
YAML

version: 2.1
# See https://circleci.com/orbs/registry/orb/circleci/gcp-gcr
orbs:
gcp-gcr: circleci/gcp-gcr@0.13.0
jobs:
run_checks:
docker:
- image: python:3.10
working_directory: ~/burnham/application
parameters:
tox_env:
type: string
steps:
- checkout:
path: ~/burnham/
- run:
name: Install tox
command: |
python -m pip install --upgrade pip
python -m pip install tox
- run:
name: Run tox
command: |
tox -e << parameters.tox_env >>
workflows:
version: 2
build:
jobs:
- run_checks:
name: Run checks << matrix.tox_env >> 🤖
matrix:
parameters:
tox_env: ["black", "flake8", "mypy", "glinter", "py310"]
filters:
tags:
# Only run this for tags using version identifiers (YY.MINOR.MICRO)
only: /^\d+\.\d+\.\d+$/
- gcp-gcr/build-and-push-image:
name: Build and push burnham:latest 📦
context: data-eng-airflow-gcr
path: application
docker-context: application
image: burnham
requires:
- run_checks
filters:
branches:
only: main
- gcp-gcr/build-and-push-image:
name: Build and push burnham-bigquery:latest 📦
context: data-eng-airflow-gcr
path: bigquery
docker-context: bigquery
image: burnham-bigquery
requires:
- run_checks
filters:
branches:
only: main
- gcp-gcr/build-and-push-image:
name: Build and push burnham 📦
context: data-eng-airflow-gcr
path: application
docker-context: application
tag: ${CIRCLE_TAG}
image: burnham
requires:
- run_checks
filters:
tags:
# Only run this for tags using version identifiers (YY.MINOR.MICRO)
only: /^\d+\.\d+\.\d+$/
branches:
# Ignore for all the branches and run only for tags
ignore: /.*/