diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c01c79e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,20 @@ +name: build +on: [pull_request, push] + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + build-all: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.8', '3.9', '3.10'] + steps: + - uses: actions/checkout@v3 + - run: | + docker build -f bin/all-py.Dockerfile \ + --build-arg PYTHON_VERSION=${{ matrix.python-version }} \ + --tag cogment_lab-all-docker . + - name: Run tests + run: docker run cogment_lab-all-docker pytest tests/* diff --git a/bin/all-py.Dockerfile b/bin/all-py.Dockerfile index 037a76f..77ccf35 100644 --- a/bin/all-py.Dockerfile +++ b/bin/all-py.Dockerfile @@ -33,7 +33,7 @@ RUN apt-get -y update \ COPY . /usr/local/cogment_lab/ WORKDIR /usr/local/cogment_lab/ -RUN pip install -r requirements.txt --no-cache-dir +RUN pip install --upgrade pip RUN pip install .[all] --no-cache-dir ENV PATH="/usr/local/bin:${PATH}" diff --git a/pyproject.toml b/pyproject.toml index f69436f..a70c366 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,7 @@ all = [ "torch", "matplotlib", "wandb>=0.13.9", - "hatch>=1.9.1", + "hatch>=1.7.0", "ruff>=0.1.7", "jupyter>=1.0.0", "jupyterlab>=3.5.3",