Skip to content

Commit

Permalink
Update build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gvinciguerra committed Mar 27, 2024
1 parent 3993f26 commit 71ff71a
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,30 @@ jobs:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
python-version: [3.5, 3.6, 3.7, 3.8]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'true'

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

- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "macOS" ]; then brew install libomp; fi
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
git submodule update --init --recursive --remote
pip install -r requirements.txt
- name: Install pygm
run: pip install .

- name: Test with pytest
run: pytest --cov-report=xml --cov pygm
working-directory: tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand All @@ -49,28 +54,19 @@ jobs:
os: [macos-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/checkout@v4
with:
python-version: "3.7"
submodules: 'true'

- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "macOS" ]; then brew install libomp; fi
python -m pip install --upgrade pip
pip install pybind11==2.5.0 cibuildwheel==1.5.5
git submodule update --init --recursive --remote
- name: Build source distribution
if: matrix.os == 'ubuntu-latest'
run: python setup.py sdist
run: if [ "$RUNNER_OS" == "macOS" ]; then brew install libomp; fi

- name: Build wheels
uses: pypa/cibuildwheel@v2.17.0
env:
CIBW_SKIP: "cp27-* pp27-* *-manylinux_i686"
run: |
if [ "$RUNNER_OS" == "macOS" ]; then export CIBW_REPAIR_WHEEL_COMMAND="delocate-listdeps {wheel} && delocate-wheel -w {dest_dir} {wheel}"; fi
python -m cibuildwheel --output-dir dist
- name: Upload artifacts
uses: actions/upload-artifact@v2
CIBW_SKIP: "*_i686"

- uses: actions/upload-artifact@v4
with:
name: wheels-and-sdist
path: dist/
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

0 comments on commit 71ff71a

Please sign in to comment.