-
Notifications
You must be signed in to change notification settings - Fork 3
84 lines (70 loc) · 2.2 KB
/
pytest-workflow.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Pytest report
on:
pull_request:
branches:
- main
- develop
push:
branches:
- main
- develop
permissions:
contents: read
jobs:
linter:
name: Black Syntax Check
runs-on: [self-hosted, "hetzner"]
if: github.repository_owner == 'Bot-detector'
steps:
- uses: actions/checkout@v3
- name: Install python3-venv package
run: sudo apt update && sudo apt install python3-venv -y
- name: Run Black
uses: psf/black@stable
with:
options: "--check --verbose"
src: "./src"
Build-Test:
name: Setup Enviornment and Run Tests
runs-on: [self-hosted, "hetzner"]
if: github.repository_owner == 'Bot-detector'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11.6"
- name: Setup Docker Containers
run: |
make setup-detached
- name: Check API is Up
uses: cygnetdigital/[email protected]
with:
url: "http://localhost:5000/docs"
responseCode: "200,500"
timeout: 120000 # wait up to 120 seconds
interval: 5000 # poll every 5 seconds
- name: Generate Pytest Report
run: |
make test-report
# https://github.com/marketplace/actions/pytest-results-actions
- name: Surface Failing Tests
if: always()
uses: pmeier/pytest-results-action@main
with:
# A list of JUnit XML files, directories containing the former, and wildcard
# patterns to process.
# See @actions/glob for supported patterns.
path: pytest_report.xml
# Add a summary of the results at the top of the report
# Default: true
summary: true
# Select which results should be included in the report.
# Follows the same syntax as
# `pytest -r`
# Default: fEX
display-options: fEX
# Fail the workflow if no JUnit XML was found.
# Default: true
fail-on-empty: true