diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index deb79e21..0c43ce4e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,6 @@ -name: Testing +name: Test -on: [push, pull_request] +on: [push] permissions: contents: read @@ -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 @@ -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 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 00000000..32317813 --- /dev/null +++ b/.github/workflows/wheels.yml @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index d904e745..dc114098 100644 --- a/README.md +++ b/README.md @@ -146,9 +146,10 @@ 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 ``` @@ -156,6 +157,7 @@ Or the lite test suite: ```shell +cd tests pytest -s -v -n auto -m lite ``` diff --git a/pyproject.toml b/pyproject.toml index b453189b..541b310a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -22,7 +37,7 @@ 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", @@ -30,7 +45,7 @@ classifiers = [ ] dependencies = [ "gymnasium", - "numpy", + "numpy<2.0.0", ] [project.urls] diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index d9619212..00000000 --- a/pytest.ini +++ /dev/null @@ -1,4 +0,0 @@ -[pytest] -addopts = --ignore=examples/externals --ignore=evogym/simulator/externals --ignore=examples/gym_test.py -markers = - lite: mark as part of the lite test suite \ No newline at end of file diff --git a/tests/pytest.ini b/tests/pytest.ini new file mode 100644 index 00000000..5da2abb9 --- /dev/null +++ b/tests/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +markers = + lite: mark as part of the lite test suite \ No newline at end of file