Skip to content

GitHub actions init for pytest #1

GitHub actions init for pytest

GitHub actions init for pytest #1

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Pytest report
on: [push, pull_request]
# push:
# branches: [ "github_action" ]
# pull_request:
# branches: [ "develop" ]
permissions:
contents: read
jobs:
linter_name:
name: Black Syntax Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: rickstaa/action-black@v1
with:
black_args: ". --check"
Build-Test:
name: Setup Enviornment and Run Tests
runs-on: ubuntu-latest
steps:
- name: Use Actions 3
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