Skip to content

Commit

Permalink
Merge eee7e6b into b1f5e67
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-caron committed May 8, 2024
2 parents b1f5e67 + eee7e6b commit 7f3cf31
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 33 deletions.
61 changes: 34 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ on:
workflow_dispatch:

jobs:
lint:
name: "Code style"
coverage:
name: "Coverage"
runs-on: ubuntu-latest

steps:
- name: "Checkout sources"
uses: actions/checkout@v3

- name: "Set up Python ${{ matrix.python-version }}"
- name: "Set up Python 3.8"
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
python-version: "3.8"

- name: "Install Debian dependencies"
run: |
Expand All @@ -28,27 +28,32 @@ jobs:
- name: "Install PyPI dependencies"
run: |
python -m pip install --upgrade pip
python -m pip install tox
python -m pip install coveralls tox
- name: "Test with tox for ${{ matrix.os }}"
run: |
tox -e lint
- name: "Check code coverage"
env:
MOSEKLM_LICENSE_FILE: ${{ secrets.MSK_LICENSE }}
PLATFORM: ubuntu-latest
run: |
tox -e coverage
coverage:
name: "Coverage"
- name: "Coveralls"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github --rcfile=pyproject.toml
lint:
name: "Code style"
runs-on: ubuntu-latest

steps:
- name: "Checkout sources"
uses: actions/checkout@v3

- name: "Set up Python 3.8"
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "${{ matrix.python-version }}"

- name: "Install Debian dependencies"
run: |
Expand All @@ -57,27 +62,22 @@ jobs:
- name: "Install PyPI dependencies"
run: |
python -m pip install --upgrade pip
python -m pip install coveralls tox
python -m pip install tox
- name: "Check code coverage"
env:
MOSEKLM_LICENSE_FILE: ${{ secrets.MSK_LICENSE }}
- name: "Test with tox for ${{ matrix.os }}"
run: |
tox -e coverage
- name: "Coveralls"
tox -e lint
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github --rcfile=pyproject.toml
MOSEKLM_LICENSE_FILE: ${{ secrets.MSK_LICENSE }}
PLATFORM: ubuntu-latest

test:
name: "Test ${{ matrix.os }} with python-${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10"]

steps:
Expand All @@ -90,12 +90,12 @@ jobs:
python-version: "${{ matrix.python-version }}"

- name: "Install Debian dependencies"
if: runner.os == 'Linux'
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt install libgmp3-dev
sudo apt install libgmp-dev
- name: "Install macOS dependencies"
if: runner.os == 'macOS'
if: matrix.os == 'macos-latest'
run: |
brew install gmp
Expand All @@ -110,3 +110,10 @@ jobs:
PLATFORM: ${{ matrix.os }}
run: |
tox
ci_success:
name: "CI success"
runs-on: ubuntu-latest
needs: [coverage, lint, test]
steps:
- run: echo "CI workflow completed successfully"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ All notable changes to this project will be documented in this file.
- CICD: Install missing Linux dependency
- CICD: Install missing macOS dependency

### Removed

- CICD: Drop macOS runners as upstream dependencies don't support that platform

## [1.0.0] - 2023/05/18

### Added
Expand Down
8 changes: 4 additions & 4 deletions tests/test_duality.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class TestDuality(unittest.TestCase):
"""Test fixture for duality conversions."""

def test_halfspace_enumeration(self):
vertices = map(
np.array,
[[1, 0, 0], [0, 1, 0], [1, 1, 0], [0, 0, 1], [0, 1, 1]],
)
vertices = [
np.array(a)
for a in [[1, 0, 0], [0, 1, 0], [1, 1, 0], [0, 0, 1], [0, 1, 1]]
]
A, b = compute_polytope_halfspaces(vertices)
self.assertEqual(A.shape[0], b.shape[0])
self.assertGreater(len(b), 4)
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
isolated_build = True
envlist = {coverage,lint}-py{38,39,310}-{linux,macos,windows}
envlist = {coverage,lint}-py{38,39,310}-{linux,windows}

[gh-actions]
python =
Expand All @@ -11,7 +11,6 @@ python =
[gh-actions:env]
PLATFORM =
ubuntu-latest: linux
macos-latest: macos
windows-latest: windows

[testenv]
Expand Down

0 comments on commit 7f3cf31

Please sign in to comment.