From 7fa3a944d842ae85ecbf6857ee65ecc2615d754c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBok?= Date: Wed, 27 Sep 2023 17:29:00 +0200 Subject: [PATCH] Add GitHub Actions workflow for auto-testing --- .github/workflows/docker.yml | 34 ++++++++++++++++++++++++++++++++++ requirements-python-2-7.txt | 2 +- test_requirements.txt | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docker.yml create mode 100644 test_requirements.txt diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..9a1c027 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,34 @@ +name: Docker CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + env: + DOCKER_IMAGE: fr3d-python + DOCKER_CONTAINER: fr3d-python-container + + steps: + - uses: actions/checkout@v3 + + - name: Build the docker image + run: DOCKER_BUILDKIT=1 docker build --progress=plain -t $DOCKER_IMAGE . + + - name: Create the docker container + run: docker create --name $DOCKER_CONTAINER $DOCKER_IMAGE + + - name: Start the docker container + run: docker start $DOCKER_CONTAINER + + - name: Install test requirements + run: docker exec $DOCKER_CONTAINER bin/bash -c "pip3 install -r test_requirements.txt" + + - name: Run test + run: docker exec $DOCKER_CONTAINER bin/bash -c "pytest" diff --git a/requirements-python-2-7.txt b/requirements-python-2-7.txt index cc74c9c..853f56b 100644 --- a/requirements-python-2-7.txt +++ b/requirements-python-2-7.txt @@ -9,7 +9,7 @@ importlib-metadata==1.6.0 importlib-resources==1.4.0 kiwisolver==1.1.0 matplotlib==2.2.5 -numpy==1.22.0 +numpy==1.16.6 pathlib2==2.3.5 pyparsing==2.4.7 python-dateutil==2.8.2 diff --git a/test_requirements.txt b/test_requirements.txt new file mode 100644 index 0000000..89e02ef --- /dev/null +++ b/test_requirements.txt @@ -0,0 +1 @@ +pytest==4.6.11