Skip to content

Add tests

Add tests #94

Workflow file for this run

name: CI/CD
on:
push:
branches:
- main
tags:
- "*"
paths:
- ".github/workflows/ci.yml"
- "**.py"
- "pdm.lock"
- "pyproject.toml"
- "!zibai/__version__.py"
pull_request:
branches:
- main
paths:
- ".github/workflows/ci.yml"
- "**.py"
- "pdm.lock"
- "pyproject.toml"
- "!zibai/__version__.py"
jobs:
tests:
name: "Python ${{ matrix.python-version }} ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: pdm-project/setup-pdm@v3
name: Setup Python and PDM
with:
python-version: ${{ matrix.python-version }}
architecture: x64
version: 2.10.4
- name: Install dependencies
run: |
pdm sync -v -dG test
- name: Tests
run: pdm run pytest tests -o log_cli=true -o log_cli_level=DEBUG
publish:
needs: tests
if: startsWith(github.ref, 'refs/tags/')
name: Publish to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- uses: pdm-project/setup-pdm@v3
name: Setup Python and PDM
with:
python-version: "3.10"
architecture: x64
version: 2.10.4
- name: Build package distributions
run: |
pdm build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1