Skip to content

Commit

Permalink
Auto build script (#43)
Browse files Browse the repository at this point in the history
* Auto build script

* Update workflows

* Update scripts

* Update scripts

* Update scripts

* Update script

* update scripts

* Update scripts

* Update scripts

* Update scripts

* Update scripts

* Update scripts

* Update scripts

* Update scripts

* Update scripts

* Install correct linux packages

* Add -y

* Change linux image

* Change linux image

* Change linux image for pypy as well

* Cleanup

* Skip musllinux, test python versions

* Add back test suite

* Update test runner

* Rename, no fail fast

* Cant build on new numpy version, ignore for now

* Cleanup
  • Loading branch information
jagdeepsb authored Jun 20, 2024
1 parent 57cc877 commit 487a4ab
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 11 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Testing
name: Test

on: [push, pull_request]
on: [push]

permissions:
contents: read
Expand All @@ -10,16 +10,17 @@ concurrency:
cancel-in-progress: true

jobs:
build:
build_and_test:
strategy:
fail-fast: false
matrix:
os:
- "ubuntu-22.04"
- "ubuntu-latest"
python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
Expand All @@ -44,3 +45,4 @@ jobs:
run: pip install -e .
- name: Run test
run: xvfb-run python -m pytest -s -v -n auto -m lite
working-directory: tests
58 changes: 58 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build

on: [push]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Window 64 bit
- os: windows-latest
platform_id: win_amd64

# Linux 64 bit
- os: ubuntu-latest
platform_id: manylinux_x86_64
manylinux_image: manylinux_2_28

# manylinux2014 dosen't work due to an issue in GLEW:
# https://github.com/glfw/glfw/issues/2139
# manylinux_image: manylinux2014

# MacOS x86_64
- os: macos-12
platform_id: macosx_x86_64

# MacOS arm64
- os: macos-14
platform_id: macosx_arm64

steps:
- uses: actions/checkout@v4
with:
submodules: true

# Used to host cibuildwheel
- uses: actions/setup-python@v5
with:
python-version: "3.8"

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.19.0

# Build wheels
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
# to supply options, put them in 'env', like:
# env:
# CIBW_SOME_OPTION: value

# Upload wheels
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,18 @@ pip install -r requirements-dev.txt

## Run Tests

Run the full test suite:
From within the `tests` directory run the full test suite:

```shell
cd tests
pytest -s -v -n auto
```

Or the lite test suite:


```shell
cd tests
pytest -s -v -n auto -m lite
```

Expand Down
19 changes: 17 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ evogym = "evogym"
[tool.setuptools.package-data]
"evogym.envs" = ["sim_files/*.json"]

[tool.cibuildwheel]
# Skip 32-bit builds, and musllinux builds
skip = ["*-win32", "*-manylinux_i686", "*-musllinux*"]

[tool.cibuildwheel.linux]

manylinux-x86_64-image = "manylinux_2_28"
manylinux-pypy_x86_64-image = "manylinux_2_28"
before-all = "yum install -y libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel mesa-libGLU-devel"
test-command = "echo 'installed'"

[[tool.cibuildwheel.overrides]]
select = "*-musllinux*"
before-all = "apk add xorg-dev libglu1-mesa-dev libglew-dev xvfb" # these package names may be wrong, untested

[project]
name = "evogym"
version = "2.0.0"
Expand All @@ -22,15 +37,15 @@ description = "Evolution Gym: A benchmark for developing and evaluating soft rob
readme = "README.md"
license = {file = "LICENSE"}
keywords = ["evolution", "gym", "evolution gym", "soft robotics", "benchmark", "co-design"]
requires-python = ">=3.7"
requires-python = ">=3.7, <3.11"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = [
"gymnasium",
"numpy",
"numpy<2.0.0",
]

[project.urls]
Expand Down
4 changes: 0 additions & 4 deletions pytest.ini

This file was deleted.

3 changes: 3 additions & 0 deletions tests/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
markers =
lite: mark as part of the lite test suite

0 comments on commit 487a4ab

Please sign in to comment.