Skip to content

Add CI Pipeline

Add CI Pipeline #39

Workflow file for this run

name: build
on:
pull_request:
push:
branches:
- main
permissions:
# Checkout repository
contents: read
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DB: glvd_test
POSTGRES_USER: user
POSTGRES_PASSWORD: password
ports:
- 5432:5432
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build image
id: build
uses: docker/build-push-action@v5
with:
file: Containerfile
load: true
# strategy:
# fail-fast: false
# matrix:
# test:
# - name: py.test
# command: py.test-3 /usr/local/src
# dependencies: ["python3-pytest", "python3-pytest-asyncio"]
# - name: mypy
# command: mypy --show-error-codes --namespace-packages /usr/local/src
# dependencies: ["mypy", "python3-pytest", "python3-urllib3/experimental"]
- name: Run flake8
if: ${{ always() }}
run: >
docker run
--network host
--rm
--entrypoint ''
${{ steps.build.outputs.imageid }}
/bin/sh -c 'apt install -y flake8 &&
mypy --show-error-codes /usr/local/src'
- name: Run py.test
if: ${{ always() }}
run: >
docker run
--network host
--rm
--entrypoint ''
--env PGUSER=user
--env PGPASSWORD=user
${{ steps.build.outputs.imageid }}
/bin/sh -c 'apt install -y python3-pytest &&
py.test /usr/local/src'
- name: Run mypy
if: ${{ always() }}
run: >
docker run
--network host
--rm
--entrypoint ''
--env PGUSER=user
--env PGPASSWORD=user
${{ steps.build.outputs.imageid }}
/bin/sh -c 'apt install -y mypy python3-pytest &&
mypy --show-error-codes /usr/local/src'