forked from openai/gym
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CI: add tests to GitHub actions (openai#2262)
* Initial CI fixes
- Loading branch information
Showing
6 changed files
with
31 additions
and
43 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: build | ||
on: [pull_request, push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: | | ||
docker build -f py.Dockerfile \ | ||
--build-arg MUJOCO_KEY=$MUJOCO_KEY \ | ||
--build-arg PYTHON_VERSION=${{ matrix.python-version }} \ | ||
--tag gym-docker . | ||
- name: Run tests | ||
run: docker run gym-docker pytest --forked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
# A Dockerfile that sets up a full Gym install with test dependencies | ||
ARG PYTHON_VER | ||
FROM python:$PYTHON_VER | ||
ARG PYTHON_VERSION | ||
FROM python:$PYTHON_VERSION | ||
RUN apt-get -y update && apt-get install -y unzip libglu1-mesa-dev libgl1-mesa-dev libosmesa6-dev xvfb patchelf ffmpeg cmake swig | ||
RUN \ | ||
|
||
# Download mujoco | ||
mkdir /root/.mujoco && \ | ||
RUN mkdir /root/.mujoco && \ | ||
cd /root/.mujoco && \ | ||
curl -O https://www.roboti.us/download/mjpro150_linux.zip && \ | ||
unzip mjpro150_linux.zip | ||
|
||
ARG PYTHON_VER | ||
ARG MUJOCO_KEY | ||
ENV MUJOCO_KEY=$MUJOCO_KEY | ||
curl -O https://www.roboti.us/download/mjpro150_linux.zip && \ | ||
unzip mjpro150_linux.zip && \ | ||
echo DUMMY_KEY > /root/.mujoco/mjkey.txt | ||
|
||
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mjpro150/bin | ||
RUN echo $MUJOCO_KEY | base64 --decode > /root/.mujoco/mjkey.txt | ||
RUN pip install pytest pytest-forked lz4 | ||
|
||
COPY . /usr/local/gym/ | ||
WORKDIR /usr/local/gym/ | ||
# install all extras for python 3.6 and 3.7, and skip mujoco add-ons for 3.8 and 3.9 | ||
# as mujoco 1.50 does not seem to work with 3.8 and 3.9 | ||
# RUN bash -c "[[ $PYTHON_VER =~ 3\.[6-7]\.[0-9] ]] && pip install -e .[all] || pip install -e .[nomujoco]" | ||
RUN pip install -e .[nomujoco] | ||
|
||
RUN pip install -e .[nomujoco] && pip install -r test_requirements.txt | ||
|
||
ENTRYPOINT ["/usr/local/gym/bin/docker_entrypoint"] | ||
CMD ["pytest","--forked"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
lz4~=3.1 | ||
pytest~=6.2 | ||
pytest-forked~=1.3 |