Skip to content

Commit

Permalink
Explicitly invoke unit test docker
Browse files Browse the repository at this point in the history
  • Loading branch information
mormahr committed Sep 13, 2021
1 parent fd83e19 commit 4320ff0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
36 changes: 16 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,38 +97,34 @@ jobs:
needs:
- build

container:
image: mormahr/pdf-service:sha-${{ github.sha }}-testing
options: --user pdf_service_user

steps:
- name: Run tests
run: |
cd /usr/src/app
python -m pytest \
-rA \
--cov=pdf_service \
--cov-report term \
--cov-report html:coverage/cov_html \
--cov-report xml:coverage/cov.xml \
--cov-report annotate:coverage/cov_annotate
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: Generated test images
path: /usr/src/app/test-data/*.png
mkdir coverage
chown 1001 coverage
docker run \
--rm \
--user pdf_service_user \
-v "$(pwd)/coverage:/usr/src/app/coverage/" \
mormahr/pdf-service:sha-${{ github.sha }}-testing \
python -m pytest \
-rA \
--cov=pdf_service \
--cov-report term \
--cov-report html:coverage/cov_html \
--cov-report xml:coverage/cov.xml \
--cov-report annotate:coverage/cov_annotate
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /usr/src/app/coverage/cov.xml
files: coverage/cov.xml
flags: unit
name: unit
fail_ci_if_error: true
verbose: true
root_dir: /usr/src/app

test-e2e:
runs-on: ubuntu-20.04
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ ADD requirements-dev.txt .

RUN pip install --user --no-cache-dir -r requirements-dev.txt

RUN mkdir -p /usr/src/app/coverage
VOLUME /usr/src/app/coverage

COPY . .

ARG GITHUB_SHA
Expand Down

0 comments on commit 4320ff0

Please sign in to comment.