-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (36 loc) · 1.12 KB
/
build.yml
File metadata and controls
40 lines (36 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Build
on:
# Triggers the test workflow on push for all branches
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
name: Run Tests
strategy:
matrix:
python-version: [ "3.9" ]
runs-on: ubuntu-latest
# Checkout the code, install poetry, install dependencies,
# and run test with coverage
steps:
- name: Environment Setup
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install Global Dependencies
run: pip install -U pip && pip install poetry wheel
- run: python -m venv .venv && source .venv/bin/activate
- name: Install Project Dependencies
run: poetry env info && poetry install
- name: Run Tests
run: |
poetry run coverage run -m pytest -v tests
poetry run coverage report -m --omit="*/test*,config/*.conf" --fail-under=70
- name: Test Image Build
env:
IMAGE_TAG: bookapi
run: |
docker build -t $IMAGE_TAG -f Dockerfile .