Skip to content

Commit

Permalink
Update GHA test workflow to run tests in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom authored and BethanyG committed Aug 14, 2023
1 parent d963aaa commit e1ae760
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 56 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
Dockerfile
bin/run-in-docker.sh
bin/run-tests-in-docker.sh
bin/run-tests.sh
test/
25 changes: 19 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,25 @@ on:
jobs:
build:
name: Test Runner
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

- name: Build Docker Image
run: docker build -f Dockerfile -t python-test-runner .
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1
with:
install: true

- name: Run Tests
run: docker run --entrypoint pytest python-test-runner -vv
- name: Build Docker image and store in cache
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
with:
context: .
push: false
load: true
tags: exercism/python-test-runner
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run Tests in Docker
run: bin/run-tests-in-docker.sh
3 changes: 1 addition & 2 deletions bin/run-tests-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ docker run \
--read-only \
--mount type=bind,src="${PWD}/test",dst=/opt/test-runner/test \
--mount type=volume,dst=/tmp \
--volume "${PWD}/bin/run-tests.sh:/opt/test-runner/bin/run-tests.sh" \
--workdir /opt/test-runner \
--entrypoint /opt/test-runner/bin/run-tests.sh \
--entrypoint pytest \
exercism/python-test-runner
47 changes: 0 additions & 47 deletions bin/run-tests.sh

This file was deleted.

0 comments on commit e1ae760

Please sign in to comment.