mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 12:51:35 +00:00
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
name: test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'tests/**'
|
|
pull_request:
|
|
types: [ opened, synchronize ]
|
|
paths:
|
|
- 'modules/apihelper/**'
|
|
- 'modules/wiki/**'
|
|
- 'tests/**'
|
|
schedule:
|
|
- cron: '0 4 * * 3'
|
|
|
|
jobs:
|
|
pytest:
|
|
name: pytest
|
|
runs-on: ${{matrix.os}}
|
|
continue-on-error: ${{ matrix.experimental }}
|
|
strategy:
|
|
matrix:
|
|
python-version: [ '3.10' ]
|
|
os: [ ubuntu-latest, windows-latest ]
|
|
experimental: [ false ]
|
|
fail-fast: False
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- 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
|
|
poetry config virtualenvs.create false
|
|
poetry install
|
|
poetry install --extras test
|
|
- name: Test with pytest
|
|
run: |
|
|
python -m pytest |