Files
httprunner/.github/workflows/unittest.yml

47 lines
1.5 KiB
YAML

name: unittest
on: [push]
jobs:
unittest on ${{ matrix.os_type }} and ${{ matrix.python-version }}:
runs-on: ${{ matrix.os_type }}
strategy:
max-parallel: 5
matrix:
os_type: [ubuntu-latest, macos-latest, windows-latest]
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