Skip to content

Refresh CI to a sane point #86

Refresh CI to a sane point

Refresh CI to a sane point #86

Workflow file for this run

name: Test
on:
push:
branches: [master]
pull_request:
branches: ["*"]
workflow_dispatch: # allows you to trigger manually
# When this workflow is queued, automatically cancel any previous running
# or pending jobs from the same branch
concurrency:
group: Test-${{ github.ref }}
cancel-in-progress: true
env:
MODULE_NAME: 'srsly'
RUN_MYPY: 'false'
jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
# FIXME: ujson segfault on 3.14
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@v5
- name: Configure Python version
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python_version }}
architecture: x64
- name: Build sdist
run: |
python -m pip install -U build pip setuptools
python -m pip install -U -r requirements.txt
python -m build --sdist
- name: Run mypy
shell: bash
if: ${{ env.RUN_MYPY == 'true' }}
run: |
python -m mypy $MODULE_NAME
- name: Delete source directory
shell: bash
run: |
rm -rf $MODULE_NAME
- name: Uninstall all packages
run: |
python -m pip freeze > installed.txt
python -m pip uninstall -y -r installed.txt
- name: Install from sdist
shell: bash
run: |
SDIST=$(python -c "import os;print(os.listdir('./dist')[-1])" 2>&1)
python -m pip install dist/$SDIST
- name: Test import
shell: bash
run: |
python -c "import $MODULE_NAME" -Werror
- name: Install test requirements
run: |
python -m pip install -U -r requirements.txt
- name: Run tests
shell: bash
run: |
python -m pytest --pyargs $MODULE_NAME -Werror