Skip to content

Commit

Permalink
feature(package): Added coverage report publishing.
Browse files Browse the repository at this point in the history
Will make only for `master` once functioning.
Changed cache settings to hopefully make multistage build faster.
  • Loading branch information
acederberg committed Aug 20, 2024
1 parent f1da375 commit 4befac6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/commit_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ jobs:
context: .
file: ./docker/dockerfile
target: ci
tags: acederberg/captura-ci # should match tags in `./docker/compose.ci.yaml`.
# NOTE: ``bumpver`` will be looking for this. Futher, this should
# match tags in ``./docker/compose.ci.yaml`` which are updated
# by bumpver.
tags: acederberg/captura-ci:0.1.5
pull: false
push: false
cache-from: type=gha
Expand All @@ -153,7 +156,7 @@ jobs:
docker compose \
--file docker/compose.ci.yaml \
--env-file .env \
up --detach --build --quiet-pull
up --detach --quiet-pull
# NOTE: ``act.yaml`` defined everything necessary for the client and server.
- name: Generate Dummy Data In Server.
Expand Down Expand Up @@ -194,15 +197,36 @@ jobs:
continue-on-error: true

- name: Create Coverage Report.
# if: github.ref == 'refs/heads/master'
run: |
docker compose \
--file docker/compose.ci.yaml \
exec server \
bash -c ' \
source ~/app/.venv/bin/activate \
&& poetry run coverage html'
&& poetry run coverage html --directory ./coverage-report'
continue-on-error: true

# --------------------------------------------------------------------- #
# NOTE: ``master`` only.

- name: Copy Coverage Report To Host.
# if: github.ref == 'refs/heads/master'
run: |
docker compose \
--file docker/compose.ci.yaml \
cp server:/home/captura/app/coverage-report ./coverage-report
- name: Put Coverage Report On GitHub Pages.
# if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: $GITHUB_BRANCH
folder: coverage-report # The folder the action should deploy.


# --------------------------------------------------------------------- #
# NOTE: Finalize.
- name: Stop Compose Project.
if: always()
run: docker compose --file docker/compose.ci.yaml down
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ push = false
"src/app/__init__.py" = ["{version}"]
"docker/compose.yaml" = ["image: acederberg/captura-development:{version}"]
"docker/compose.ci.yaml" = ["image: acederberg/captura-ci:{version}"]
".github/workflows/" = ["tags: acederberg/captura-ci:{version}"]


[tool.setuptools_scm]
Expand Down

0 comments on commit 4befac6

Please sign in to comment.