remove unittest.yaml
This commit is contained in:
parent
dc28e9187b
commit
6716a47823
2
.github/workflows/pre-commit.yaml
vendored
2
.github/workflows/pre-commit.yaml
vendored
@ -14,7 +14,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout Source Code
|
- name: Checkout Source Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Set up Python
|
- name: Set up Python 3.12
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.12'
|
python-version: '3.12'
|
||||||
|
47
.github/workflows/unittest.yaml
vendored
47
.github/workflows/unittest.yaml
vendored
@ -1,47 +0,0 @@
|
|||||||
name: Unit Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'dev'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
python-version: ['3.12']
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
cache: 'pip'
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -r requirements.txt
|
|
||||||
pip install pytest
|
|
||||||
- name: Run tests with pytest
|
|
||||||
run: |
|
|
||||||
pytest app/ | tee unittest.txt
|
|
||||||
- name: Show failed tests and summary
|
|
||||||
run: |
|
|
||||||
grep -E "FAILED|ERROR|[0-9]+ passed," unittest.txt
|
|
||||||
failed_count=$(grep -E "FAILED|ERROR" unittest.txt | wc -l)
|
|
||||||
if [[ "$failed_count" -gt 0 ]]; then
|
|
||||||
echo "$failed_count failed tests found! Task failed."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
- name: Upload test results
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: pytest-results-${{ matrix.python-version }}
|
|
||||||
path: ./unittest.txt
|
|
||||||
retention-days: 3
|
|
||||||
if: ${{ always() }}
|
|
Loading…
x
Reference in New Issue
Block a user