mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-25 08:46:48 +02:00
feat: add github actions unittest
This commit is contained in:
parent
3125441505
commit
db6b6a90d7
1 changed files with 47 additions and 0 deletions
47
.github/workflows/unittest.yaml
vendored
Normal file
47
.github/workflows/unittest.yaml
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
name: Python application test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
# python-version: ['3.9', '3.10', '3.11']
|
||||
python-version: ['3.9']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -e.
|
||||
npm install -g @mermaid-js/mermaid-cli
|
||||
playwright install --with-deps chromium
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pip install pytest pytest-asyncio pytest-cov pytest-html
|
||||
export OPENAI_API_KEY="${{ secrets.OPENAI_API_KEY }}" OPENAI_API_MODEL="gpt-3.5-turbo-1106"
|
||||
export PYPPETEER_EXECUTABLE_PATH="/usr/bin/chromium"
|
||||
pytest tests/ --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov=./metagpt/ --cov-report=xml:cov.xml --cov-report=html:htmlcov
|
||||
coverage report -m
|
||||
- name: Upload pytest test results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: pytest-results-${{ matrix.python-version }}
|
||||
path: |
|
||||
./junit/test-results-${{ matrix.python-version }}.xml
|
||||
./htmlcov/
|
||||
retention-days: 3
|
||||
if: ${{ always() }}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue