Skip to content

Commit

Permalink
ci: test on Windows and MacOS (#109)
Browse files Browse the repository at this point in the history
### Summary of Changes

Also run tests on Windows and MacOS. Behavior of `torch` and Python's
multiprocessing is platform-dependent.
  • Loading branch information
lars-reimann authored May 4, 2024
1 parent 72a8846 commit b55f44e
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 13 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Main

on:
push:
branches: [ main ]
Expand All @@ -7,14 +8,19 @@ jobs:
poetry-with-codecov:
strategy:
matrix:
platform:
- "ubuntu-latest"
- "macos-latest"
- "windows-latest"
python-version:
- '3.11'
- '3.12'
- "3.11"
- "3.12"
uses: lars-reimann/.github/.github/workflows/poetry-codecov-reusable.yml@main
with:
working-directory: .
platform: ${{ matrix.platform }}
python-version: ${{ matrix.python-version }}
module-name: safeds_runner
coverage: ${{ matrix.python-version == '3.11' }}
coverage: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.11' }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
13 changes: 9 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Pull Request

on:
pull_request:
branches: [main]
branches: [ main ]

concurrency:
group: ${{ github.head_ref }}-${{ github.workflow }}
Expand All @@ -12,14 +12,19 @@ jobs:
poetry-with-codecov:
strategy:
matrix:
platform:
- "ubuntu-latest"
- "macos-latest"
- "windows-latest"
python-version:
- '3.11'
- '3.12'
- "3.11"
- "3.12"
uses: lars-reimann/.github/.github/workflows/poetry-codecov-reusable.yml@main
with:
working-directory: .
platform: ${{ matrix.platform }}
python-version: ${{ matrix.python-version }}
module-name: safeds_runner
coverage: ${{ matrix.python-version == '3.11' }}
coverage: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.11' }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
97 changes: 94 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ simple-websocket = "^1.0.0"
torch = [
# Install the CUDA version on Windows. Projects that depend on us always get their dependencies from PyPI, so
# there's no point moving this to the main dependencies section.
{ version = "^2.3.0", markers="sys_platform == 'win32'", source = "torch_cuda121" },
{ version = "^2.3.0", markers="sys_platform == 'win32'", source = "torch_cuda" },
{ version = "^2.3.0", markers="sys_platform != 'win32'", source = "pypi" },
]
torchvision = [
# Install the CUDA version on Windows. Projects that depend on us always get their dependencies from PyPI, so
# there's no point moving this to the main dependencies section.
{ version = "^0.18.0", markers="sys_platform == 'win32'", source = "torch_cuda121" },
{ version = "^0.18.0", markers="sys_platform == 'win32'", source = "torch_cuda" },
{ version = "^0.18.0", markers="sys_platform != 'win32'", source = "pypi" },
]

[tool.poetry.group.docs.dependencies]
Expand All @@ -46,7 +48,7 @@ mkdocs-glightbox = "^0.3.4"
mkdocs-material = "^9.1.17"

[[tool.poetry.source]]
name = "torch_cuda121"
name = "torch_cuda"
url = "https://download.pytorch.org/whl/cu121"
priority = "explicit"

Expand Down

0 comments on commit b55f44e

Please sign in to comment.