Set default value of OMP_NUM_THREADS to zero (and not None) #425
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python: ["3.11", "3.10", "3.9", "3.8", "3.7"] | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install OS Packages | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install gfortran | |
- name: Run tests | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install pytest-cov numpy Cython | |
python setup.py build_ext -i | |
python -m pip install . | |
pytest --cov-report html --cov-report xml --cov-report annotate --cov=pixell pixell/tests/ -s | |
- uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
verbose: true # optional (default = false) | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# Ensure that a wheel builder finishes even if another fails | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04] | |
cp: [cp37, cp38, cp39, cp310, cp311] | |
include: | |
- cp: cp37 | |
numpyver: "1.20" | |
- cp: cp38 | |
numpyver: "1.20" | |
- cp: cp39 | |
numpyver: "1.20" | |
- cp: cp310 | |
numpyver: "1.22" | |
- cp: cp311 | |
numpyver: "1.22" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
name: Install Python | |
with: | |
python-version: '3.7' | |
- name: Install cibuildwheel and other dependencies | |
run: | | |
python -m pip install -U pip | |
python -m easy_install -U setuptools | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install pytest-cov numpy | |
python -m pip install cibuildwheel | |
- name: Test and build wheels | |
run: bash scripts/build_wheels.sh | |
env: | |
CIBW_ENVIRONMENT: OMP_NUM_THREADS=2 | |
OPENBLAS_NUM_THREADS=2 | |
CIBW_BEFORE_BUILD: "python -m pip install numpy==${{ matrix.numpyver }} scipy cython" | |
CIBW_BUILD_VERBOSITY: 3 | |
CIBW_BUILD: "${{ matrix.cp }}-*x86_64" | |
CIBW_SKIP: "*-musllinux_*" | |
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2" | |
PYTHON: "python" | |
PIP: "pip" | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
name: Install Python | |
with: | |
python-version: '3.7' | |
- name: Build sdist | |
run: | | |
python -m pip install -U pip | |
python -m easy_install -U setuptools | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install numpy | |
python setup.py sdist | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: dist/*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
# upload to PyPI on every tag starting with 'v' | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | |
# alternatively, to publish when a GitHub Release is created, use the following rule: | |
# if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
# To test: repository_url: https://test.pypi.org/legacy/ |