Skip to content

Add test for running code in new thread #123

Add test for running code in new thread

Add test for running code in new thread #123

Workflow file for this run

name: Tests
on:
workflow_dispatch:
inputs:
deploy:
description: 'Release this branch'
required: false
type: boolean
release:
types: [created]
pull_request:
jobs:
test_manylinux:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64 # Need a relatively modern platform for the actions to work
strategy:
matrix:
python-version: [cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311]
steps:
- uses: actions/checkout@v2
- name: Set up Python
run: |
echo "/opt/python/${{ matrix.python-version }}/bin" >> $GITHUB_PATH
echo $PATH
- name: Install dependencies
run: pip install tox==4.6.3 tox-gh==1.2.0
- name: Test wheel with tox
run: python -m tox
- name: Audit wheel
run: auditwheel repair .tox/.pkg/dist/*.whl -w wheelhouse${{ matrix.python-version }}
- name: Upload wheel
uses: actions/upload-artifact@v2
with:
name: dist
path: wheelhouse${{ matrix.python-version }}/*
test_alpine:
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
container:
- "python:3.7-alpine"
- "python:3.8-alpine"
- "python:3.9-alpine"
- "python:3.10-alpine"
- "python:3.11-alpine"
steps:
- name: Install packages
# gcc and musl-dev needed for compiling the package
# git needed for checkout
# patchelf needed for auditwheel
run: apk add gcc musl-dev git patchelf
- uses: actions/checkout@v2
- name: Install dependencies
run: pip install tox==4.6.3 tox-gh==1.2.0 auditwheel
- name: Test wheel with tox
run: python -m tox
- name: Audit wheel
run: auditwheel repair .tox/.pkg/dist/*.whl -w audited_wheels
- name: Upload dists
uses: actions/upload-artifact@v2
with:
name: dist
path: audited_wheels/*
test_windows:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
arch: [ x86, x64 ]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch }}
- name: Install dependencies
run: python -m pip install tox==4.6.3 tox-gh==1.2.0
- name: Test with tox
run: python -m tox
- name: Upload dists
uses: actions/upload-artifact@v2
with:
name: dist
path: .tox/.pkg/dist/*
test_mac:
runs-on: macos-13
strategy:
fail-fast: false
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: sudo python -m pip install tox==4.6.3 tox-gh==1.2.0
- name: Test with tox
run: sudo -E python -m tox
- name: Upload dists
uses: actions/upload-artifact@v2
with:
name: dist
path: .tox/.pkg/dist/*
publish:
if: (github.event_name == 'release' && github.event.action == 'created') || inputs.deploy
needs: [test_manylinux, test_alpine, test_windows]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m pip install twine
python -m twine check dist/*
python -m twine upload --skip-existing dist/*