From 71ff71ae0584c031d0d217975c88d9022302a93f Mon Sep 17 00:00:00 2001 From: Giorgio Vinciguerra Date: Wed, 27 Mar 2024 17:53:45 +0100 Subject: [PATCH] Update build workflow --- .github/workflows/build.yml | 48 +++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee6291d..28de263 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -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