Skip to content

Run unitests.

Run unitests. #146

name: Build, Test & Publush
# Controls when the action will run.
on:
# Triggers the workflow on all push or pull request events
push:
pull_request:
release:
types: [created]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
# added using https://github.com/step-security/secure-repo
permissions:
contents: read
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build_and_test_python:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
compiler: ['gcc', 'clang']
os: [macos, ubuntu]
# include:
# Would be cool, but not yet :(. Someone, please make a PR.
# - python-version: '3.10'
# compiler: microsoft
# os: windows
# - python-version: '3.11'
# compiler: microsoft
# os: windows
# - python-version: '3.12'
# compiler: microsoft
# os: windows
runs-on: ${{ matrix.os }}-latest
env:
COMPILER: ${{ matrix.compiler }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade build setuptools wheel
shell: bash
- name: build
run: CC=${COMPILER} LDSHARED="${COMPILER} -shared" python setup.py build sdist
shell: bash
- name: install
run: pip install dist/*.gz
shell: bash
- name: test
run: |
python -m unittest discover -v -s tests -p '*.py'
shell: bash
build_wheels:
permissions:
packages: write
needs: build_and_test_python
uses: sippy/cimagic/.github/workflows/BuildPythonWheels.yml@v1
publish_all_wheels:
needs: build_wheels
permissions:
actions: read
contents: read
uses: sippy/cimagic/.github/workflows/PublishWheels.yml@v1