Files
httprunner/.github/workflows/unittest.yml
2020-06-29 19:11:29 +08:00

52 lines
1.5 KiB
YAML

name: unittest
on: [push]
jobs:
unittest:
name: unittest - ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 12
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry --version
poetry install -vv
- name: Run unittest for httprunner
run: |
poetry run httprunner
poetry run hmake
poetry run hrun
poetry run har2case
poetry run coverage run --source=httprunner -m pytest tests
- name: coverage report
run: |
poetry run coverage xml
poetry run coverage report -m
- name: Codecov
uses: codecov/codecov-action@v1.0.5
with:
# User defined upload name. Visible in Codecov UI
name: httprunner
# Repository upload token - get it from codecov.io
token: ${{ secrets.CODECOV_TOKEN }}
# Path to coverage file to upload
file: ./coverage.xml
# Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)
flags: unittests
# Specify whether or not CI build should fail if Codecov runs into an error during upload
fail_ci_if_error: true