242 lines
6.1 KiB
YAML
242 lines
6.1 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
schedule:
|
|
- cron: '1 0 * * *' # Run daily at 0:01 UTC
|
|
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build_docs:
|
|
name: Build Docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.10'
|
|
|
|
- name: Install tox
|
|
run: python -m pip install --upgrade tox
|
|
|
|
- name: Build docs with tox
|
|
run: tox -e docs
|
|
|
|
build_package:
|
|
name: Build Package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '16.x'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build app.js
|
|
run: npm run build:ci
|
|
|
|
- name: Build and Check Package
|
|
uses: hynek/build-and-inspect-python-package@v1
|
|
|
|
test_javascript:
|
|
name: Run javascript unit tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '16.x'
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Run tests
|
|
run: npm run unit
|
|
- name: Upload coverage to codecov
|
|
if: >-
|
|
${{
|
|
! github.event.schedule &&
|
|
github.repository_owner == 'pytest-dev'
|
|
}}
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
fail_ci_if_error: true
|
|
files: ./cobertura-coverage.xml
|
|
flags: js_tests
|
|
name: ubuntu-latest-node-16
|
|
verbose: true
|
|
|
|
test_unit:
|
|
name: ${{ matrix.os }} - ${{ matrix.python-version }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
python-version: ["3.7", "3.8", "3.9", "3.10"]
|
|
include:
|
|
- os: ubuntu-latest
|
|
python-version: "3.10"
|
|
with-coverage: true
|
|
|
|
- os: ubuntu-latest
|
|
python-version: pypy3.9
|
|
tox-env: py3.9
|
|
- os: windows-latest
|
|
python-version: pypy3.9
|
|
tox-env: py3.9
|
|
- os: macos-latest
|
|
python-version: pypy3.9
|
|
tox-env: py3.9
|
|
|
|
- os: ubuntu-latest
|
|
python-version: 3.11-dev
|
|
tox-env: devel
|
|
- os: windows-latest
|
|
python-version: 3.11-dev
|
|
tox-env: devel
|
|
- os: macos-latest
|
|
python-version: 3.11-dev
|
|
tox-env: devel
|
|
|
|
steps:
|
|
- name: Set newline behavior
|
|
run: git config --global core.autocrlf false
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '16.x'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build app
|
|
run: npm run build:ci
|
|
|
|
- name: Set up python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install tox
|
|
run: python -m pip install --upgrade tox
|
|
|
|
- name: Run unit tests
|
|
if: ${{ ! matrix.tox-env && matrix.with-coverage }}
|
|
run: tox -e py${{ matrix.python-version }}-cov -- testing/test_unit.py
|
|
|
|
- name: Run unit tests
|
|
if: ${{ ! matrix.tox-env && ! matrix.with-coverage }}
|
|
run: tox -e py${{ matrix.python-version }} -- testing/test_unit.py
|
|
|
|
- name: Run unit tests
|
|
if: ${{ matrix.tox-env }}
|
|
run: tox -e ${{ matrix.tox-env }} -- testing/test_unit.py
|
|
|
|
- name: Upload coverage to codecov
|
|
if: >-
|
|
${{
|
|
! github.event.schedule &&
|
|
matrix.with-coverage &&
|
|
github.repository_owner == 'pytest-dev'
|
|
}}
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
fail_ci_if_error: true
|
|
files: ./coverage.xml
|
|
flags: py_unit_tests
|
|
name: ${{ matrix.os }}-python-${{ matrix.python-version }}
|
|
verbose: true
|
|
|
|
test_integration:
|
|
name: ubuntu - ${{ matrix.python-version }}
|
|
needs:
|
|
- test_javascript
|
|
- test_unit
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ["3.7", "3.8", "3.9", "3.10"]
|
|
include:
|
|
- python-version: "3.10"
|
|
with-coverage: true
|
|
- python-version: pypy3.9
|
|
tox-env: py3.9
|
|
- python-version: 3.11-dev
|
|
tox-env: devel
|
|
|
|
steps:
|
|
- name: Set newline behavior
|
|
run: git config --global core.autocrlf false
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Start chrome
|
|
run: ./start
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '16.x'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build app
|
|
run: npm run build:ci
|
|
|
|
- name: Set up python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install tox
|
|
run: python -m pip install --upgrade tox
|
|
|
|
- name: Run integration tests
|
|
if: ${{ ! matrix.tox-env && matrix.with-coverage }}
|
|
run: tox -e ${{ matrix.python-version }}-cov -- testing/test_integration.py
|
|
|
|
- name: Run integration tests
|
|
if: ${{ ! matrix.tox-env && ! matrix.with-coverage }}
|
|
run: tox -e ${{ matrix.python-version }} -- testing/test_integration.py
|
|
|
|
- name: Run integration tests
|
|
if: ${{ matrix.tox-env }}
|
|
run: tox -e ${{ matrix.tox-env }} -- testing/test_integration.py
|
|
|
|
- name: Upload coverage to codecov
|
|
if: >-
|
|
${{
|
|
! github.event.schedule &&
|
|
matrix.with-coverage &&
|
|
github.repository_owner == 'pytest-dev'
|
|
}}
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
fail_ci_if_error: true
|
|
files: ./coverage.xml
|
|
flags: py_integration_tests
|
|
name: ubuntu-latest-${{ matrix.python-version }}
|
|
verbose: true
|