diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..75f28d28 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,47 @@ +name: Test + +on: [push] + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + strategy: + matrix: + os: + - "ubuntu-latest" + python: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + - name: Update deb repository + run: sudo apt-get update + - name: Install deb dependencies + run: sudo apt-get install -y xorg-dev libglu1-mesa-dev libglew-dev xvfb + - name: Install python dependencies + run: pip install -r requirements-dev.txt + - name: Cache python wheel packages + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: wheel-cache-${{ hashFiles('requirements-dev.txt') }} + - name: Install evolution gym + run: pip install -e . + - name: Run test + run: xvfb-run pytest -s -v -n auto -m lite + working-directory: tests 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/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