mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-28 00:24:11 +00:00
233e7ab58d
Co-authored-by: luoshuijs <luoshuijs@outlook.com> Co-authored-by: Karako <karakohear@gmail.com> Co-authored-by: xtaodada <xtao@xtaolink.cn>
45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
name: Test modules
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'tests/unit/**'
|
|
pull_request:
|
|
types: [ opened, synchronize ]
|
|
paths:
|
|
- 'modules/apihelper/**'
|
|
- 'modules/wiki/**'
|
|
- 'tests/unit/**'
|
|
|
|
jobs:
|
|
pytest:
|
|
name: pytest
|
|
runs-on: ${{matrix.os}}
|
|
continue-on-error: ${{ matrix.experimental }}
|
|
strategy:
|
|
matrix:
|
|
os: [ ubuntu-latest, windows-latest ]
|
|
fail-fast: False
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
- name: Set up Python 3.11
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.11
|
|
- 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'
|
|
run: |
|
|
pip install --upgrade poetry
|
|
pip install git+https://github.com/pypa/installer.git
|
|
poetry config virtualenvs.create false
|
|
poetry install
|
|
poetry install --extras test
|
|
- name: Test with pytest
|
|
run: |
|
|
python -m pytest tests/unit |