34
.github/workflows/unit-test-report.yaml
vendored
Normal file
34
.github/workflows/unit-test-report.yaml
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
---
|
||||
|
||||
name: 'Process Unit Test Artifact'
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- 'Unit Test'
|
||||
types:
|
||||
- completed
|
||||
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
checks: write
|
||||
|
||||
|
||||
jobs:
|
||||
report:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12']
|
||||
steps:
|
||||
|
||||
- name: Test Report
|
||||
uses: dorny/test-reporter@v1
|
||||
with:
|
||||
artifact: unit-test-results-${{ matrix.python-version }}
|
||||
name: Unit Test Report [Python ${{ matrix.python-version }}]
|
||||
path: '*.xml'
|
||||
reporter: java-junit
|
69
.github/workflows/unit-test.yaml
vendored
Normal file
69
.github/workflows/unit-test.yaml
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
name: 'Unit Test'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "development"
|
||||
tags:
|
||||
- '*'
|
||||
pull_request:
|
||||
branches:
|
||||
- "development"
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12']
|
||||
|
||||
steps:
|
||||
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
pip install -r requirements_test.txt
|
||||
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
cd app;
|
||||
pytest --cov --cov-report term --cov-report xml:../coverage.xml --cov-report html:../coverage/ --junit-xml=../unit.JUnit.xml **/tests/unit;
|
||||
|
||||
|
||||
- name: Upload Test Report
|
||||
uses: actions/upload-artifact@v4
|
||||
if: success() || failure()
|
||||
with:
|
||||
name: unit-test-results-${{ matrix.python-version }}
|
||||
path: unit.JUnit.xml
|
||||
|
||||
|
||||
- name: Upload Coverage Report
|
||||
uses: actions/upload-artifact@v4
|
||||
if: success() || failure()
|
||||
with:
|
||||
name: coverage-report-${{ matrix.python-version }}
|
||||
path: coverage.xml
|
||||
|
||||
|
||||
- name: Upload Coverage
|
||||
uses: actions/upload-artifact@v4
|
||||
if: success() || failure()
|
||||
with:
|
||||
name: coverage-${{ matrix.python-version }}
|
||||
path: coverage/*
|
Reference in New Issue
Block a user