Skip to content

Commit

Permalink
Merge 0d6c27e into 7aac41f
Browse files Browse the repository at this point in the history
  • Loading branch information
willgraf committed Dec 15, 2021
2 parents 7aac41f + 0d6c27e commit e15c824
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/tests.yaml
Expand Up @@ -66,3 +66,40 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

test-docker:
name: Build Docker and Run Tests

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and Run Unit Tests
env:
IMAGE: ${{ github.repository }}:${{ github.sha }}
NAME: kiosk_client
run: |
docker buildx build --load --tag ${{ env.IMAGE }} .
docker run -d -it \
--entrypoint=/bin/sh \
--name $NAME \
${{ env.IMAGE }}
docker cp requirements-test.txt $NAME:/usr/src/app/requirements-test.txt
docker exec $NAME pip install -r requirements-test.txt
docker exec $NAME pytest
docker kill $NAME && docker rm $NAME
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,4 +1,4 @@
FROM python:3.6-slim-buster
FROM python:3.8-slim-bullseye

WORKDIR /usr/src/app

Expand Down

0 comments on commit e15c824

Please sign in to comment.