diff options
author | Gard Spreemann <gspr@nonempty.org> | 2021-11-09 17:06:47 +0100 |
---|---|---|
committer | Gard Spreemann <gspr@nonempty.org> | 2021-11-09 17:06:47 +0100 |
commit | 3d10287c776e95427ace867b302cff02488694ca (patch) | |
tree | 5735b6434fe7a14b775d266e1a5d7720b56912e4 /.github/workflows | |
parent | cc703fc5e204a4b1c03fc29e59687e6b97aa7f67 (diff) | |
parent | 1a283cb0c77f79d6f36de7c01fa61dc8d9696bca (diff) |
Merge branch 'dfsg/latest' into debian/sid
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/build_tests.yml | 97 | ||||
-rw-r--r-- | .github/workflows/build_wheels.yml | 62 | ||||
-rw-r--r-- | .github/workflows/build_wheels_weekly.yml | 54 |
3 files changed, 161 insertions, 52 deletions
diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index 41b08b3..ee5a435 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -1,10 +1,13 @@ -name: build +name: Tests on: - push: - + workflow_dispatch: pull_request: - + branches: + - 'master' + push: + branches: + - 'master' create: branches: - 'master' @@ -15,10 +18,11 @@ jobs: linux: runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'no ci')" strategy: max-parallel: 4 matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [ "3.6", "3.7", "3.8", "3.9"] steps: - uses: actions/checkout@v1 @@ -26,63 +30,70 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} + - name: Install POT + run: | + pip install -e . - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install flake8 pytest "pytest-cov<2.6" codecov - pip install -U "sklearn" - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 examples/ ot/ test/ --count --max-line-length=127 --statistics - - name: Install POT - run: | - pip install -e . + pip install pytest "pytest-cov<2.6" codecov - name: Run tests run: | - python -m pytest -v test/ ot/ --doctest-modules --ignore ot/gpu/ --cov=ot + python -m pytest --durations=20 -v test/ ot/ --doctest-modules --ignore ot/gpu/ --cov=ot --color=yes - name: Upload codecov run: | codecov + pep8: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'no pep8')" + steps: + - uses: actions/checkout@v1 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 examples/ ot/ test/ --count --max-line-length=127 --statistics linux-minimal-deps: runs-on: ubuntu-latest - strategy: - max-parallel: 4 - matrix: - python-version: [3.6] - + if: "!contains(github.event.head_commit.message, 'no ci')" steps: - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v1 with: - python-version: ${{ matrix.python-version }} + python-version: 3.9 - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r .github/requirements_strict.txt pip install pytest - pip install -U "sklearn" - name: Install POT run: | pip install -e . - name: Run tests run: | - python -m pytest -v test/ ot/ --ignore ot/gpu/ + python -m pytest --durations=20 -v test/ ot/ --ignore ot/gpu/ --color=yes macos: - runs-on: macOS-latest + runs-on: macos-latest + if: "!contains(github.event.head_commit.message, 'no ci')" strategy: max-parallel: 4 matrix: - python-version: [3.7] + python-version: ["3.7", "3.8", "3.9"] steps: - uses: actions/checkout@v1 @@ -90,26 +101,26 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} + - name: Install POT + run: | + pip install -e . - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install pytest "pytest-cov<2.6" - pip install -U "sklearn" - - name: Install POT - run: | - pip install -e . - name: Run tests run: | - python -m pytest -v test/ ot/ --doctest-modules --ignore ot/gpu/ --cov=ot + python -m pytest --durations=20 -v test/ ot/ --doctest-modules --ignore ot/gpu/ --cov=ot --color=yes windows: - runs-on: windows-2019 + runs-on: windows-latest + if: "!contains(github.event.head_commit.message, 'no ci')" strategy: max-parallel: 4 matrix: - python-version: [3.7] + python-version: ["3.7", "3.8", "3.9"] steps: - uses: actions/checkout@v1 @@ -117,15 +128,15 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} + - name: Install POT + run: | + python -m pip install -e . - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt - pip install pytest "pytest-cov<2.6" - pip install -U "sklearn" - - name: Install POT - run: | - pip install -e . + python -m pip install -r .github/requirements_test_windows.txt + python -m pip install torch==1.8.1+cpu -f https://download.pytorch.org/whl/torch_stable.html + python -m pip install pytest "pytest-cov<2.6" - name: Run tests run: | - python -m pytest -v test/ ot/ --doctest-modules --ignore ot/gpu/ --cov=ot + python -m pytest --durations=20 -v test/ ot/ --doctest-modules --ignore ot/gpu/ --cov=ot --color=yes diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 662a604..a935a5e 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -1,19 +1,21 @@ -name: Build dist and wheels +name: Build wheels on: + workflow_dispatch: release: + pull_request: push: branches: - - "master" + - "*" jobs: build_wheels: name: ${{ matrix.os }} runs-on: ${{ matrix.os }} + if: "contains(github.event.head_commit.message, 'build wheels')" strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - # macos-latest, windows-latest steps: - uses: actions/checkout@v1 @@ -30,17 +32,58 @@ jobs: - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==1.3.0 + python -m pip install cibuildwheel==2.2.2 - - name: Install Visual C++ for Python 2.7 - if: startsWith(matrix.os, 'windows') + - name: Build wheels + env: + CIBW_SKIP: "pp*-win* pp*-macosx* cp2* pp*" # remove pypy on mac and win (wrong version) + CIBW_BEFORE_BUILD: "pip install numpy cython" + run: | + python -m cibuildwheel --output-dir wheelhouse + + - uses: actions/upload-artifact@v1 + with: + name: wheels + path: ./wheelhouse + + + build_all_wheels: + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} + if: "contains(github.event.head_commit.message, 'build all wheels')" + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -U "cython" + + - name: Install cibuildwheel run: | - choco install vcpython27 -f -y + python -m pip install cibuildwheel==2.2.2 - - name: Build wheel + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v1 + with: + platforms: all + + - name: Build wheels env: - CIBW_SKIP: "pp*-win* pp*-macosx* cp2* pp*" # remove pypy on mac and win (wrong version) + CIBW_SKIP: "pp*-win* pp*-macosx* cp2* pp* cp*musl*" # remove pypy on mac and win (wrong version) CIBW_BEFORE_BUILD: "pip install numpy cython" + CIBW_ARCHS_LINUX: auto aarch64 # force aarch64 with QEMU + CIBW_ARCHS_MACOS: x86_64 universal2 arm64 run: | python -m cibuildwheel --output-dir wheelhouse @@ -48,3 +91,4 @@ jobs: with: name: wheels path: ./wheelhouse + diff --git a/.github/workflows/build_wheels_weekly.yml b/.github/workflows/build_wheels_weekly.yml new file mode 100644 index 0000000..2964844 --- /dev/null +++ b/.github/workflows/build_wheels_weekly.yml @@ -0,0 +1,54 @@ +name: Build all wheels + +on: + workflow_dispatch: + schedule: + - cron: '30 0 * * 1' + push: + branches: + - "master" + +jobs: + build_wheels: + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -U "cython" + + - name: Install cibuildwheel + run: | + python -m pip install cibuildwheel==2.2.2 + + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v1 + with: + platforms: all + + - name: Build wheels + env: + CIBW_SKIP: "pp*-win* pp*-macosx* cp2* pp* cp*musl*" # remove pypy on mac and win (wrong version) + CIBW_BEFORE_BUILD: "pip install numpy cython" + CIBW_ARCHS_LINUX: auto aarch64 # force aarch64 with QEMU + CIBW_ARCHS_MACOS: x86_64 universal2 arm64 + run: | + python -m cibuildwheel --output-dir wheelhouse + + - uses: actions/upload-artifact@v1 + with: + name: wheels + path: ./wheelhouse |