mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
46 lines
1.4 KiB
YAML
46 lines
1.4 KiB
YAML
name: unittest
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
unittest:
|
|
|
|
runs-on: [ubuntu-latest, macos-latest, windows-latest]
|
|
strategy:
|
|
max-parallel: 5
|
|
matrix:
|
|
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
|
|
|
|
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 python -m httprunner.cli hrun -V
|
|
poetry run python -m httprunner.cli hrun -h
|
|
poetry run coverage run --source=httprunner -m unittest discover
|
|
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
|