Skip to content

Merge branch 'master' of https://github.com/colinxu2020/slhdsa #19

Merge branch 'master' of https://github.com/colinxu2020/slhdsa

Merge branch 'master' of https://github.com/colinxu2020/slhdsa #19

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Test And Build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- 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 pdm
python -m pdm install
python -m pdm install -dG dev
- name: Test with pytest
run: |
python -m pdm run pytest tests --cov --cov-report xml:cov.xml
- name: Check with mypy
run: |
python -m pdm run mypy slhdsa --disallow-untyped-defs
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./cov.xml
build_optimized:
name: Build optimized wheels on ${{ matrix.os }}
needs: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
steps:
- uses: actions/checkout@v4
# Used to host cibuildwheel
- uses: actions/setup-python@v5
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.19.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
SLHDSA_BUILD_OPTIMIZED: "1"
- uses: actions/upload-artifact@v4
with:
name: slhdsa-optimized-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_unoptimized:
name: Build unoptimized wheels
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Used to host cibuildwheel
- uses: actions/setup-python@v5
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.19.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: slhdsa-unoptimized-wheels-${{ strategy.job-index }}
path: ./wheelhouse/*.whl