diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml deleted file mode 100644 index 09055ea..0000000 --- a/.github/workflows/build-linux.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Build for Linux -on: - workflow_call: - inputs: - python-version: - required: true - type: string - outputs: - wheel_name: - description: "Wheel name" - value: ${{ jobs.build-wheel.outputs.name }} - -jobs: - build-wheel: - runs-on: ubuntu-latest - outputs: - name: ${{ steps.output-wheel-name.outputs.wheel_name }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - run: docker run --rm -v `pwd`:/replicat -w /replicat quay.io/pypa/manylinux2014_x86_64 bash -c \ - 'python${{ inputs.python-version }} -m build --wheel && auditwheel repair dist/*.whl --plat manylinux2014_x86_64 --wheel-dir manylinux/' - - run: echo "WHEEL_NAME=$(basename $(ls manylinux/*.whl))" >> $GITHUB_ENV - - id: output-wheel-name - run: echo "wheel_name=${{ env.WHEEL_NAME }}" >> $GITHUB_OUTPUT - - uses: actions/upload-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - path: manylinux/${{ env.WHEEL_NAME }} diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml deleted file mode 100644 index ea33661..0000000 --- a/.github/workflows/build-macos.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Build for macOS -on: - workflow_call: - inputs: - python-version: - required: true - type: string - outputs: - wheel_name: - description: "Wheel name" - value: ${{ jobs.build-wheel.outputs.name }} - -jobs: - build-wheel: - runs-on: macos-latest - outputs: - name: ${{ steps.output-wheel-name.outputs.wheel_name }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{ inputs.python-version }} - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.12 - - name: Check cmake - run: cmake --version - - run: python -m pip install -U pip setuptools build - - run: python -m build --wheel - env: - MACOSX_DEPLOYMENT_TARGET: '10.10' - - run: echo "WHEEL_NAME=$(basename $(ls dist/*.whl))" >> $GITHUB_ENV - - id: output-wheel-name - run: echo "wheel_name=${{ env.WHEEL_NAME }}" >> $GITHUB_OUTPUT - - uses: actions/upload-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - path: dist/${{ env.WHEEL_NAME }} diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml new file mode 100644 index 0000000..bd6cd1a --- /dev/null +++ b/.github/workflows/build-wheels.yml @@ -0,0 +1,27 @@ +name: Build and test wheels +on: + workflow_call: + inputs: + include-pre-release-pythons: + required: true + type: string +jobs: + build-wheels: + name: Build and test wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + steps: + - uses: actions/checkout@v4 + - name: Build wheels + uses: pypa/cibuildwheel@v2.16.2 + env: + CIBW_ARCHS: "auto64" + CIBW_BUILD: "cp*" + CIBW_TEST_EXTRAS: "test" + CIBW_TEST_COMMAND: "python -m pytest --pyargs replicat.tests" + CIBW_PRERELEASE_PYTHONS: ${{ inputs.include-pre-release-pythons }} + - uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml deleted file mode 100644 index 48928ac..0000000 --- a/.github/workflows/build-windows.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Build for Windows -on: - workflow_call: - inputs: - python-version: - required: true - type: string - outputs: - wheel_name: - description: "Wheel name" - value: ${{ jobs.build-wheel.outputs.name }} - -jobs: - build-wheel: - runs-on: windows-latest - outputs: - name: ${{ steps.output-wheel-name.outputs.wheel_name }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{ inputs.python-version }} - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.12 - - name: Check cmake - run: cmake --version - - run: python -m pip install -U pip setuptools build - - run: python -m build --wheel - - run: echo "WHEEL_NAME=$(basename $(ls dist/*.whl))" >> $GITHUB_ENV - shell: bash - - id: output-wheel-name - run: echo "wheel_name=${{ env.WHEEL_NAME }}" >> $GITHUB_OUTPUT - shell: bash - - uses: actions/upload-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - path: dist/${{ env.WHEEL_NAME }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 040329e..f335c2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,335 +11,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - run: ./scripts/lint --check-only --install - # 3.8 builds - build-38-windows: + build-wheels: needs: lint - uses: ./.github/workflows/build-windows.yml + uses: ./.github/workflows/build-wheels.yml with: - python-version: '3.8' - - build-38-linux: - needs: lint - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.8' - - build-38-macos: - needs: lint - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.8' - - # 3.8 tests - test-38-windows: - needs: build-38-windows - runs-on: windows-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.8' - - run: echo "WHEEL_NAME=${{ needs.build-38-windows.outputs.wheel_name }}" >> $GITHUB_ENV - shell: bash - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests - - test-38-linux: - needs: build-38-linux - runs-on: ubuntu-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.8' - - run: echo "WHEEL_NAME=${{ needs.build-38-linux.outputs.wheel_name }}" >> $GITHUB_ENV - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests - - test-38-macos: - needs: build-38-macos - runs-on: macos-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.8' - - run: echo "WHEEL_NAME=${{ needs.build-38-macos.outputs.wheel_name }}" >> $GITHUB_ENV - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests - - # 3.9 builds - build-39-windows: - needs: lint - uses: ./.github/workflows/build-windows.yml - with: - python-version: '3.9' - - build-39-linux: - needs: lint - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.9' - - build-39-macos: - needs: lint - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.9' - - # 3.9 tests - test-39-windows: - needs: build-39-windows - runs-on: windows-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.9' - - run: echo "WHEEL_NAME=${{ needs.build-39-windows.outputs.wheel_name }}" >> $GITHUB_ENV - shell: bash - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests - - test-39-linux: - needs: build-39-linux - runs-on: ubuntu-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.9' - - run: echo "WHEEL_NAME=${{ needs.build-39-linux.outputs.wheel_name }}" >> $GITHUB_ENV - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests - - test-39-macos: - needs: build-39-macos - runs-on: macos-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.9' - - run: echo "WHEEL_NAME=${{ needs.build-39-macos.outputs.wheel_name }}" >> $GITHUB_ENV - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests - - # 3.10 builds - build-310-windows: - needs: lint - uses: ./.github/workflows/build-windows.yml - with: - python-version: '3.10' - - build-310-linux: - needs: lint - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.10' - - build-310-macos: - needs: lint - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.10' - - # 3.10 tests - test-310-windows: - needs: build-310-windows - runs-on: windows-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.10' - - run: echo "WHEEL_NAME=${{ needs.build-310-windows.outputs.wheel_name }}" >> $GITHUB_ENV - shell: bash - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests - - test-310-linux: - needs: build-310-linux - runs-on: ubuntu-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.10' - - run: echo "WHEEL_NAME=${{ needs.build-310-linux.outputs.wheel_name }}" >> $GITHUB_ENV - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests - - test-310-macos: - needs: build-310-macos - runs-on: macos-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.10' - - run: echo "WHEEL_NAME=${{ needs.build-310-macos.outputs.wheel_name }}" >> $GITHUB_ENV - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests - - # 3.11 builds - build-311-windows: - needs: lint - uses: ./.github/workflows/build-windows.yml - with: - python-version: '3.11' - - build-311-linux: - needs: lint - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.11' - - build-311-macos: - needs: lint - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.11' - - # 3.11 tests - test-311-windows: - needs: build-311-windows - runs-on: windows-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - run: echo "WHEEL_NAME=${{ needs.build-311-windows.outputs.wheel_name }}" >> $GITHUB_ENV - shell: bash - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests - - test-311-linux: - needs: build-311-linux - runs-on: ubuntu-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - run: echo "WHEEL_NAME=${{ needs.build-311-linux.outputs.wheel_name }}" >> $GITHUB_ENV - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests - - test-311-macos: - needs: build-311-macos - runs-on: macos-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - run: echo "WHEEL_NAME=${{ needs.build-311-macos.outputs.wheel_name }}" >> $GITHUB_ENV - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests - - # 3.12 builds - build-312-windows: - needs: lint - uses: ./.github/workflows/build-windows.yml - with: - python-version: '3.12' - - build-312-linux: - needs: lint - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.12' - - build-312-macos: - needs: lint - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.12' - - # 3.12 tests - test-312-windows: - needs: build-312-windows - runs-on: windows-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.12' - - run: echo "WHEEL_NAME=${{ needs.build-312-windows.outputs.wheel_name }}" >> $GITHUB_ENV - shell: bash - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests - - test-312-linux: - needs: build-312-linux - runs-on: ubuntu-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.12' - - run: echo "WHEEL_NAME=${{ needs.build-312-linux.outputs.wheel_name }}" >> $GITHUB_ENV - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests - - test-312-macos: - needs: build-312-macos - runs-on: macos-latest - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.12' - - run: echo "WHEEL_NAME=${{ needs.build-312-macos.outputs.wheel_name }}" >> $GITHUB_ENV - - uses: actions/download-artifact@v2 - with: - name: ${{ env.WHEEL_NAME }} - - run: python -m pip install ${{ env.WHEEL_NAME }}[test] - - run: python -m pytest --pyargs replicat.tests + include-pre-release-pythons: "true" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae28a2a..6669901 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,117 +3,29 @@ on: workflow_dispatch: jobs: - # 3.8 builds - build-38-windows: - uses: ./.github/workflows/build-windows.yml + build-wheels: + uses: ./.github/workflows/build-wheels.yml with: - python-version: '3.8' - - build-38-linux: - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.8' - - build-38-macos: - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.8' - - # 3.9 builds - build-39-windows: - uses: ./.github/workflows/build-windows.yml - with: - python-version: '3.9' - - build-39-linux: - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.9' - - build-39-macos: - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.9' - - # 3.10 builds - build-310-windows: - uses: ./.github/workflows/build-windows.yml - with: - python-version: '3.10' - - build-310-linux: - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.10' - - build-310-macos: - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.10' - - # 3.11 builds - build-311-windows: - uses: ./.github/workflows/build-windows.yml - with: - python-version: '3.11' - - build-311-linux: - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.11' - - build-311-macos: - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.11' - - # 3.12 builds - build-312-windows: - uses: ./.github/workflows/build-windows.yml - with: - python-version: '3.12' - - build-312-linux: - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.12' - - build-312-macos: - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.12' + include-pre-release-pythons: "false" build-sdist: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - run: python -m pip install build - run: python -m build --sdist - - run: echo "SDIST_NAME=$(basename $(ls dist/*.tar.gz))" >> $GITHUB_ENV - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: - name: ${{ env.SDIST_NAME }} - path: dist/${{ env.SDIST_NAME }} + path: dist/*.tar.gz upload: needs: - - build-38-windows - - build-38-linux - - build-38-macos - - build-39-windows - - build-39-linux - - build-39-macos - - build-310-windows - - build-310-linux - - build-310-macos - - build-311-windows - - build-311-linux - - build-311-macos + - build-wheels - build-sdist runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 - name: Artifacts tree structure run: ls -R - run: python -m pip install twine diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 4f31570..496a9dc 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -3,117 +3,29 @@ on: workflow_dispatch: jobs: - # 3.8 builds - build-38-windows: - uses: ./.github/workflows/build-windows.yml + build-wheels: + uses: ./.github/workflows/build-wheels.yml with: - python-version: '3.8' - - build-38-linux: - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.8' - - build-38-macos: - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.8' - - # 3.9 builds - build-39-windows: - uses: ./.github/workflows/build-windows.yml - with: - python-version: '3.9' - - build-39-linux: - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.9' - - build-39-macos: - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.9' - - # 3.10 builds - build-310-windows: - uses: ./.github/workflows/build-windows.yml - with: - python-version: '3.10' - - build-310-linux: - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.10' - - build-310-macos: - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.10' - - # 3.11 builds - build-311-windows: - uses: ./.github/workflows/build-windows.yml - with: - python-version: '3.11' - - build-311-linux: - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.11' - - build-311-macos: - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.11' - - # 3.12 builds - build-312-windows: - uses: ./.github/workflows/build-windows.yml - with: - python-version: '3.12' - - build-312-linux: - uses: ./.github/workflows/build-linux.yml - with: - python-version: '3.12' - - build-312-macos: - uses: ./.github/workflows/build-macos.yml - with: - python-version: '3.12' + include-pre-release-pythons: "false" build-sdist: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - run: python -m pip install build - run: python -m build --sdist - - run: echo "SDIST_NAME=$(basename $(ls dist/*.tar.gz))" >> $GITHUB_ENV - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: - name: ${{ env.SDIST_NAME }} - path: dist/${{ env.SDIST_NAME }} + path: dist/*.tar.gz upload: needs: - - build-38-windows - - build-38-linux - - build-38-macos - - build-39-windows - - build-39-linux - - build-39-macos - - build-310-windows - - build-310-linux - - build-310-macos - - build-311-windows - - build-311-linux - - build-311-macos + - build-wheels - build-sdist runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 - name: Artifacts tree structure run: ls -R - run: python -m pip install twine