Add test to write empty graph, read graph again and check if num node… #7
This file contains hidden or 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 wheels | |
| on: [push, pull_request] | |
| # Default parameters for all builds | |
| env: | |
| ARTIFACT_RETENTION: ${{ github.ref == 'refs/heads/master' && '30' || '7' }} | |
| jobs: | |
| cpython-linux-x86_64: | |
| name: 'Linux CPython (${{ matrix.cibw_archs }}, ${{ matrix.manylinux_image }})' | |
| runs-on: ubuntu-20.04 | |
| strategy: | |
| matrix: | |
| cibw_archs: ["x86_64"] | |
| manylinux_image: ["manylinux2014"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-python@v5 | |
| name: Install Python | |
| with: | |
| python-version: '3.12' | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v2.21.1 | |
| env: | |
| CIBW_BEFORE_BUILD: pip install cython | |
| CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} | |
| CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs }} | |
| CIBW_BUILD: ${{ github.ref == 'refs/heads/master' && 'cp310-* cp311-* cp312-* cp313-*' || 'cp312-*' }} | |
| CIBW_SKIP: "pp* *-musllinux_*" | |
| - uses: actions/upload-artifact@v4 | |
| if: github.ref == 'refs/heads/master' | |
| with: | |
| name: 'linux-${{ matrix.cibw_archs }}-cp310-${{ github.run_id }}' | |
| path: ./wheelhouse/*cp310*.whl | |
| retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| - uses: actions/upload-artifact@v4 | |
| if: github.ref == 'refs/heads/master' | |
| with: | |
| name: 'linux-${{ matrix.cibw_archs }}-cp311-${{ github.run_id }}' | |
| path: ./wheelhouse/*cp311*.whl | |
| retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: 'linux-${{ matrix.cibw_archs }}-cp312-${{ github.run_id }}' | |
| path: ./wheelhouse/*cp312*.whl | |
| retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| - uses: actions/upload-artifact@v4 | |
| if: github.ref == 'refs/heads/master' | |
| with: | |
| name: 'linux-${{ matrix.cibw_archs }}-cp313-${{ github.run_id }}' | |
| path: ./wheelhouse/*cp313*.whl | |
| retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| # THIS ACTION IS DISABLED DUE TO SEGMENTATION FAULT IN GCC COMPILER | |
| # Additional note: continue-on-error does not work currently for cibuildwheel: | |
| # https://github.com/pypa/cibuildwheel/issues/1062 | |
| # cpython-linux-aarch64: | |
| # name: 'Linux CPython (${{ matrix.cibw_archs }}, ${{ matrix.manylinux_image }})' | |
| # runs-on: ${{ matrix.os }} | |
| # strategy: | |
| # matrix: | |
| # os: [ubuntu-20.04] | |
| # cibw_archs: ["aarch64"] | |
| # manylinux_image: ["manylinux2014"] | |
| # steps: | |
| # - name: Set up QEMU | |
| # uses: docker/setup-qemu-action@v3 | |
| # with: | |
| # platforms: all | |
| # - uses: actions/checkout@v4 | |
| # with: | |
| # submodules: true | |
| # - uses: actions/setup-python@v5 | |
| # name: Install Python | |
| # with: | |
| # python-version: '3.12' | |
| # - name: Build wheels | |
| # uses: pypa/cibuildwheel@v2.21.1 | |
| # env: | |
| # CIBW_BEFORE_BUILD: pip install cython | |
| # CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} | |
| # CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs }} | |
| # CIBW_BUILD: ${{ github.ref == 'refs/heads/master' && 'cp312-* cp313-*' || 'cp312-*' }} | |
| # CIBW_SKIP: "pp* *-musllinux_*" | |
| # - uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: 'linux-${{ matrix.cibw_archs }}-cp312-${{ github.run_id }}' | |
| # path: ./wheelhouse/*cp312*.whl | |
| # retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| # - uses: actions/upload-artifact@v4 | |
| # if: github.ref == 'refs/heads/master' | |
| # with: | |
| # name: 'linux-${{ matrix.cibw_archs }}-cp313-${{ github.run_id }}' | |
| # path: ./wheelhouse/*cp313*.whl | |
| # retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| cpython-macos: | |
| name: 'macOS CPython (${{ matrix.buildplat[1] }})' | |
| runs-on: ${{ matrix.buildplat[0] }} | |
| strategy: | |
| matrix: | |
| buildplat: | |
| - [macos-13, x86_64, ''] | |
| - [macos-latest, arm64, NETWORKIT_OSX_CROSSBUILD=ON] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-python@v5 | |
| name: Install Python | |
| with: | |
| python-version: '3.12' | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v2.21.1 | |
| env: | |
| CIBW_BEFORE_BUILD: | |
| pip install cython && | |
| brew install libomp ninja | |
| CIBW_ARCHS_MACOS: ${{ matrix.buildplat[1] }} | |
| CIBW_BUILD: ${{ github.ref == 'refs/heads/master' && 'cp310-* cp311-* cp312-* cp313-*' || 'cp312-*' }} | |
| CIBW_ENVIRONMENT: CXX='c++' ${{ matrix.buildplat[2] }} MACOSX_DEPLOYMENT_TARGET='14.0' | |
| CIBW_SKIP: "pp* *-musllinux_*" | |
| - uses: actions/upload-artifact@v4 | |
| if: github.ref == 'refs/heads/master' | |
| with: | |
| name: 'macos-${{ matrix.buildplat[1] }}-cp310-${{ github.run_id }}' | |
| path: ./wheelhouse/*cp310*.whl | |
| retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| - uses: actions/upload-artifact@v4 | |
| if: github.ref == 'refs/heads/master' | |
| with: | |
| name: 'macos-${{matrix.buildplat[1] }}-cp311-${{ github.run_id }}' | |
| path: ./wheelhouse/*cp311*.whl | |
| retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: 'macos-${{ matrix.buildplat[1] }}-cp312-${{ github.run_id }}' | |
| path: ./wheelhouse/*cp312*.whl | |
| retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| - uses: actions/upload-artifact@v4 | |
| if: github.ref == 'refs/heads/master' | |
| with: | |
| name: 'macos-${{ matrix.buildplat[1] }}-cp313-${{ github.run_id }}' | |
| path: ./wheelhouse/*cp313*.whl | |
| retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| cpython-windows: | |
| name: 'Windows CPython (${{ matrix.cibw_archs }})' | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| cibw_archs: [amd64] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup devCmd (vstools) | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - uses: actions/setup-python@v5 | |
| name: Install Python | |
| with: | |
| python-version: '3.12' | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v2.21.1 | |
| env: | |
| CIBW_BEFORE_BUILD: pip install cython ipython | |
| CIBW_ARCHS: "AMD64" | |
| CIBW_BUILD: ${{ github.ref == 'refs/heads/master' && 'cp310-* cp311-* cp312-* cp313-*' || 'cp312-*' }} | |
| CIBW_SKIP: pp* | |
| - uses: actions/upload-artifact@v4 | |
| if: github.ref == 'refs/heads/master' | |
| with: | |
| name: 'win-${{ matrix.cibw_archs }}-cp310-${{ github.run_id }}' | |
| path: ./wheelhouse/*cp310*.whl | |
| retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| - uses: actions/upload-artifact@v4 | |
| if: github.ref == 'refs/heads/master' | |
| with: | |
| name: 'win-${{ matrix.cibw_archs }}-cp311-${{ github.run_id }}' | |
| path: ./wheelhouse/*cp311*.whl | |
| retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: 'win-${{ matrix.cibw_archs }}-cp312-${{ github.run_id }}' | |
| path: ./wheelhouse/*cp312*.whl | |
| retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| - uses: actions/upload-artifact@v4 | |
| if: github.ref == 'refs/heads/master' | |
| with: | |
| name: 'win-${{ matrix.cibw_archs }}-cp313-${{ github.run_id }}' | |
| path: ./wheelhouse/*cp313*.whl | |
| retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| source-distribution: | |
| name: 'Source distribution' | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-python@v5 | |
| name: Install Python | |
| with: | |
| python-version: '3.12' | |
| - name: Create sdist source | |
| run: | | |
| pip install cython numpy setuptools | |
| python3 setup.py build_ext | |
| python3 setup.py sdist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: 'sdist-${{ github.run_id }}.tar.gz' | |
| path: ./dist/*networkit*.tar.gz | |
| retention-days: ${{ env.ARTIFACT_RETENTION }} | |
| # This job checks whether the current workflow is triggered by a new tag with the following form: INT.INT or INT.INT.INT (for example: 1.0, 1.0.1, ...) | |
| # The result is saved in a variable and used as a conditional variable when uploading packages. | |
| check-release-tag: | |
| name: "Check for new release" | |
| runs-on: ubuntu-latest | |
| outputs: | |
| is-release: ${{ steps.do-check.outputs.is-release }} | |
| steps: | |
| - name: Check release tag ${{ github.ref }} | |
| id: do-check | |
| run: | | |
| if [[ ${{ github.ref }} =~ ^refs\/tags\/[0-9]+\.[0-9]+(\.[0-9]+)?$ ]]; then | |
| echo "::set-output name=is-release::true" | |
| else | |
| echo "::set-output name=is-release::false" | |
| fi | |
| upload-packages: | |
| if: needs.check-release-tag.outputs.is-release == 'true' && github.repository == 'networkit/networkit' | |
| name: 'PyPi release upload' | |
| runs-on: ubuntu-22.04 | |
| needs: [cpython-macos, cpython-linux-x86_64, cpython-windows, source-distribution, check-release-tag] | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: ./dist | |
| - uses: actions/setup-python@v5 | |
| name: Install Python | |
| with: | |
| python-version: '3.12' | |
| - name: Upload to TestPyPI | |
| run: | | |
| unzip "./dist/artifact/*.zip" | |
| pip install twine | |
| python3 -m twine upload --verbose --skip-existing ./dist/artifact/* | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }} | |