From 377efb72ae5380fa1de266fc63f057c0f32adf57 Mon Sep 17 00:00:00 2001 From: mattip Date: Tue, 19 Apr 2022 11:02:39 +0300 Subject: [PATCH] add pytest-html testing --- .github/workflows/cython.yml | 2 +- .github/workflows/pytest-html.yml | 74 +++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pytest-html.yml diff --git a/.github/workflows/cython.yml b/.github/workflows/cython.yml index f804b8d..6c13f8e 100644 --- a/.github/workflows/cython.yml +++ b/.github/workflows/cython.yml @@ -26,7 +26,7 @@ on: jobs: # This workflow contains a single job called "build" cython: - name: Test ${{ matrix.python_version }} ${{ matrix.os }} ${{ matrix.extra_cflags }} + name: Cython ${{ matrix.python_version }} ${{ matrix.os }} ${{ matrix.extra_cflags }} runs-on: ${{ matrix.os }}-latest strategy: fail-fast: false diff --git a/.github/workflows/pytest-html.yml b/.github/workflows/pytest-html.yml new file mode 100644 index 0000000..c56bfae --- /dev/null +++ b/.github/workflows/pytest-html.yml @@ -0,0 +1,74 @@ +name: pytest-html + +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + branches: [ main ] + pull_request: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + + schedule: + # ┌───────────── minute (0 - 59) + # │ ┌───────────── hour (0 - 23) + # │ │ ┌───────────── day of the month (1 - 31) + # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) + # │ │ │ │ │ + - cron: "0 2 * * 0" + +jobs: + test_python: + name: pytest-html ${{ matrix. }} + name: pytest-html ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + name: py38-ubuntu + python-version: 3.8 + + - os: windows-latest + name: py38-windows + python-version: 3.8 + + - os: ubuntu-latest + name: pypy3-ubuntu + python-version: pypy3.8-nightly + + - os: windows-latest + name: pypy3-windows + python-version: pypy3.8 + + steps: + - name: Set Newline Behavior + run : git config --global core.autocrlf false + - uses: actions/checkout@v3 + + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + repository: pytest-dev/pytest-html + path: repo + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix['python-version'] }} + + - name: Install tox + run: python -m pip install --upgrade tox + + - name: Get Tox Environment Name From Matrix Name + uses: rishabhgupta/split-by@v1 + id: split-matrix-name + with: + string: '${{ matrix.name }}' + split-by: '-' + + - name: Test with tox + run: cd repo && python -m tox -e ${{ steps.split-matrix-name.outputs._0}}-cov +