Skip to content

Build and test service #321

Build and test service

Build and test service #321

Workflow file for this run

name: Build and test service
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
schedule:
# 7am EST / 8am EDT Mondays
- cron: '0 12 * * 1'
jobs:
build-test:
if: |
github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
|| ! contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install hatch
run: pip install hatch
- name: Build the image
run: |
VERSION=`hatch version | tail -n1`
echo $VERSION
docker compose build --build-arg BUILDTYPE=latest-test --build-arg DEPLOYSERVER=uvicorn --build-arg VERSION=$VERSION
- name: Start all the things
run: docker compose up -d
- name: Test the things
run: docker exec app bash -c "pytest /src/migas/server"
- name: Stop all the things
run: docker compose down