Skip to content

Commit

Permalink
Add test job in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillemdb committed Aug 30, 2024
1 parent 49fb0c6 commit 3d1dafe
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
BOT_NAME: fragile-bot
BOT_EMAIL: [email protected]
DOCKER_ORG: fragiletech
PIP_CACHE: |
LOCAL_CACHE: |
~/.cache/pip
~/.local/bin
~/.local/lib/python3.*/site-packages
Expand All @@ -33,7 +33,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Enable caching and define a custom cache key prefix
- name: Setup Rye
id: setup-rye
uses: eifinger/setup-rye@v4
with:
Expand All @@ -48,39 +48,46 @@ jobs:
pytest:
name: Run Pytest
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'Bump version')"
strategy:
matrix:
python-version: ['3.10']
python-version: ['3.10', '3.11', '3.12']
steps:
- name: actions/checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup Rye
id: setup-rye
uses: eifinger/setup-rye@v4
with:
enable-cache: true
cache-prefix: ubuntu-latest-rye-test-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
- name: actions/cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ env.PIP_CACHE }}
key: ubuntu-20.04-pip-test-${{ matrix.python-version }}-${{ hashFiles('requirements.txt', 'requirements-test.txt') }}
restore-keys: ubuntu-20.04-pip-test-
path: ${{ env.LOCAL_CACHE }}
key: ubuntu-latest-system-test-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: ubuntu-latest-system-test
- name: Install test and package dependencies
run: |
set -x
sudo apt-get install -y xvfb -y
sudo MUJOCO_PATH=/home/runner/.mujoco/ make install-envs
pip install -r requirements-test.txt -r requirements.txt
rye pin --relaxed cpython@${{ matrix.python-version }}
rye sync --all-features
ROM_PASSWORD=${{ secrets.ROM_PASSWORD }} make import-roms
pip install .
- name: Test with pytest
run: |
set -x
make test-codecov
xvfb-run -s "-screen 0 1400x900x24" rye run test
- name: Upload coverage report
if: ${{ matrix.python-version=='3.8' }}
if: ${{ matrix.python-version=='3.12' }}
uses: codecov/codecov-action@v1

test-docker:
Expand Down

0 comments on commit 3d1dafe

Please sign in to comment.