2023-03-14 01:27:22 +00:00
|
|
|
name: Test modules
|
2022-09-12 08:24:04 +00:00
|
|
|
|
|
|
|
on:
|
2022-09-12 08:39:44 +00:00
|
|
|
push:
|
2022-09-12 08:24:04 +00:00
|
|
|
branches:
|
2022-09-12 08:39:44 +00:00
|
|
|
- main
|
|
|
|
paths:
|
2023-03-14 01:27:22 +00:00
|
|
|
- 'tests/unit/**'
|
2022-09-12 08:39:44 +00:00
|
|
|
pull_request:
|
|
|
|
types: [ opened, synchronize ]
|
|
|
|
paths:
|
2022-09-12 15:20:17 +00:00
|
|
|
- 'modules/apihelper/**'
|
|
|
|
- 'modules/wiki/**'
|
2023-03-14 01:27:22 +00:00
|
|
|
- 'tests/unit/**'
|
2022-09-12 08:24:04 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
pytest:
|
2022-09-15 02:22:40 +00:00
|
|
|
name: pytest
|
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
continue-on-error: ${{ matrix.experimental }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ ubuntu-latest, windows-latest ]
|
|
|
|
fail-fast: False
|
2022-09-12 08:24:04 +00:00
|
|
|
steps:
|
2023-03-14 01:27:22 +00:00
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Python 3.11
|
|
|
|
uses: actions/setup-python@v2
|
2022-09-12 08:24:04 +00:00
|
|
|
with:
|
2023-03-14 01:27:22 +00:00
|
|
|
python-version: 3.11
|
2022-10-08 16:12:31 +00:00
|
|
|
- name: restore or create a python virtualenv
|
|
|
|
id: cache
|
|
|
|
uses: syphar/restore-virtualenv@v1.2
|
|
|
|
- name: Create venv
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
2022-09-12 08:24:04 +00:00
|
|
|
run: |
|
|
|
|
pip install --upgrade poetry
|
2023-02-28 14:15:48 +00:00
|
|
|
pip install git+https://github.com/pypa/installer.git
|
2022-09-12 09:24:33 +00:00
|
|
|
poetry config virtualenvs.create false
|
2022-09-12 08:24:04 +00:00
|
|
|
poetry install
|
|
|
|
poetry install --extras test
|
|
|
|
- name: Test with pytest
|
|
|
|
run: |
|
2023-03-14 01:27:22 +00:00
|
|
|
python -m pytest tests/unit
|