diff --git a/.github/workflows/docker_ci_main.yml b/.github/workflows/docker_ci_main.yml new file mode 100644 index 0000000..5910fec --- /dev/null +++ b/.github/workflows/docker_ci_main.yml @@ -0,0 +1,16 @@ + +name: CI - Main +on: + pull_request: + branches: + - main +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Build and test with Docker + run: | + docker build -t example_python_package_image . + docker run --rm example_python_package_image /bin/bash -c "bash run_tests.sh" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 4bdd877..fca0e3a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM continuumio/miniconda3:4.9.2 -ARG compile_cores=6 +ARG compile_cores=1 RUN apt-get --yes update && apt-get --yes upgrade @@ -15,4 +15,13 @@ RUN conda install -c conda-forge -c python python=3.8 && \ pip install jupyter-cadquery==2.1.0 && \ # change to clone repo and pip install locally pip install paramak && \ - conda clean -afy \ No newline at end of file + conda clean -afy + +COPY run_tests.sh run_tests.sh +COPY tests tests/ + +COPY README.md README.md +COPY example_python_package example_python_package/ +COPY setup.py setup.py + +RUN python setup.py install \ No newline at end of file diff --git a/run_tests.sh b/run_tests.sh new file mode 100644 index 0000000..82a1260 --- /dev/null +++ b/run_tests.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +pytest tests/test_multiplication.py \ No newline at end of file diff --git a/tests/test_multiplication.py b/tests/test_multiplication.py index b928bda..2492a21 100644 --- a/tests/test_multiplication.py +++ b/tests/test_multiplication.py @@ -7,4 +7,4 @@ def test_multiplication_small_numbers(): def test_multiplication_large_numbers(): result = multiply_two_numbers(100, 300) - assert result == 30000 \ No newline at end of file + assert result == None \ No newline at end of file