Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
79 changes: 33 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,43 @@
name: CI

on: [push]
on:
push:
branches: [master]
pull_request:

jobs:
build:
test:
name: test (${{ matrix.os }}, ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}

strategy:
max-parallel: 4
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.12', '3.13', '3.14']

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install libomp
run: |
brew install libomp
if: matrix.os == 'macos-latest'

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"

- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install hyperjet

- name: Install package
run: |
pip install .
python -c "import eqlib; print('eqlib._USE_MKL', eqlib._USE_MKL)"
shell: pwsh

- name: Test with pytest
run: |
pip install pytest
pytest
- uses: actions/checkout@v7
with:
fetch-depth: 0 # setuptools-scm needs the tag history

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

- name: Install package
run: |
pip install .
python -c "import eqlib; print('eqlib', eqlib.__version__, '_USE_MKL', eqlib._USE_MKL)"

- name: Install test dependencies
run: pip install pytest

# hyperjet is optional for the tests (they are skipped if it is missing)
- name: Install hyperjet
run: pip install "hyperjet @ git+https://github.com/oberbichler/HyperJet"
continue-on-error: true

- name: Run tests
run: pytest
130 changes: 45 additions & 85 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,105 +2,65 @@ name: Publish

on:
release:
types: [created]
types: [published]
workflow_dispatch:

jobs:
win_mac:
name: publish (${{ matrix.os }}, ${{ matrix.python-version }})

build_wheels:
name: wheels (${{ matrix.os }})
runs-on: ${{ matrix.os }}

strategy:
max-parallel: 4
fail-fast: false
matrix:
os: [windows-latest, macOS-latest]
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest]

steps:
- uses: actions/checkout@v1

- name: Install libomp
run: |
brew install libomp
if: matrix.os == 'macos-latest'

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v7
with:
fetch-depth: 0 # setuptools-scm needs the tag history

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install -r requirements.txt
- name: Build wheels
uses: pypa/cibuildwheel@v4.1.1

- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pumpit --tag "${{ github.ref }}" --file setup.py --replace "EQLIB_VERSION = 'dev'" "EQLIB_VERSION = '%VERSION%'"
python setup.py bdist_wheel
twine upload dist/*.whl

linux:
name: publish (ubuntu-latest, ${{ matrix.python-version }})
- uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl

build_sdist:
name: sdist
runs-on: ubuntu-latest

container:
image: oberbichler/manylinux2010_x86_64
env:
PLAT: manylinux2010_x86_64
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0

strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8, 3.9]
- name: Build sdist
run: pipx run build --sdist

steps:
- uses: actions/checkout@v1
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
if [ "${PYTHON_VERSION}" == "3.7" ]; then PYBIN=/opt/python/cp37-cp37m/bin; fi
if [ "${PYTHON_VERSION}" == "3.8" ]; then PYBIN=/opt/python/cp38-cp38/bin; fi
if [ "${PYTHON_VERSION}" == "3.9" ]; then PYBIN=/opt/python/cp39-cp39/bin; fi
PATH=${PYBIN}:$PATH
pip install --upgrade pip
pip install -r requirements.txt
pumpit --tag "${{ github.ref }}" --file setup.py --replace "EQLIB_VERSION = 'dev'" "EQLIB_VERSION = '%VERSION%'"
pip wheel . -w wheelhouse/
for whl in wheelhouse/eqlib-*.whl; do
auditwheel repair "$whl" --plat $PLAT -w wheelhouse/
done
for whl in wheelhouse/eqlib-*-${PLAT}.whl; do
twine upload "$whl"
done

source:
name: publish (source)
- uses: actions/upload-artifact@v7
with:
name: sdist
path: dist/*.tar.gz

publish:
name: publish to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/eqlib

permissions:
id-token: write # PyPI trusted publishing

steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install -r requirements.txt
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pumpit --tag "${{ github.ref }}" --file setup.py --replace "EQLIB_VERSION = 'dev'" "EQLIB_VERSION = '%VERSION%'"
python setup.py sdist
twine upload dist/*
- uses: actions/download-artifact@v8
with:
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
Loading
Loading