Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added docker ci action #7

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/docker_ci_main.yml
Original file line number Diff line number Diff line change
@@ -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"
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
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
3 changes: 3 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

pytest tests/test_multiplication.py
2 changes: 1 addition & 1 deletion tests/test_multiplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ def test_multiplication_small_numbers():

def test_multiplication_large_numbers():
result = multiply_two_numbers(100, 300)
assert result == 30000
assert result == None