Skip to content

Commit

Permalink
Merge pull request #83 from UpstreamDataInc/dev_pre-commit_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
b-rowan authored Aug 23, 2024
2 parents 954f41e + d8e6a30 commit 3b4fde3
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .djlintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignore": "H030,H031"
"ignore": "H030,H031,H021"
}
34 changes: 34 additions & 0 deletions .github/workflows/pr-run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test PRs

on:
pull_request:
jobs:
run-tests:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: poetry install --with tests
- name: Run tests
env:
REPORT_OUTPUT: md_report.md
shell: bash
run: |
echo "REPORT_FILE=${REPORT_OUTPUT}" >> "$GITHUB_ENV"
poetry run pytest -v --md-report --md-report-flavor gfm --md-report-exclude-outcomes passed skipped xpassed --md-report-output "$REPORT_OUTPUT"
- name: Render the report to the PR when tests fail
uses: marocchino/sticky-pull-request-comment@v2
if: failure()
with:
header: test-report
recreate: true
path: ${{ env.REPORT_FILE }}
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
ci:
skip:
- pytest
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand Down
9 changes: 5 additions & 4 deletions goosebit/ui/templates/nav.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@
<body data-bs-theme="dark">
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="/ui/home">
<a class="navbar-brand" href="{{ request.url_for("home_ui") }}">
<img src="{{ request.url_for('static', path='svg/goosebit-logo.svg') }}"
class="me-2"
style="height: 30px;
width: 30px" />
height="30px"
width="30px"
alt="gooseBit logo" />
gooseBit
</a>
<button class="navbar-toggler"
Expand All @@ -74,7 +75,7 @@
{% endfor %}
</div>
<div class="navbar-nav d-flex flex-fill justify-content-end">
<a class="nav-link" href="/logout">Logout<i class="bi bi-box-arrow-right ps-2"></i></a>
<a class="nav-link" href="{{ request.url_for("logout") }}">Logout<i class="bi bi-box-arrow-right ps-2"></i></a>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ mkdocs-material = "^9.5.29"
[tool.poetry.group.tests.dependencies]
pytest = "^8.3.1"
pytest-asyncio = "^0.23.8"
pytest-md-report = "^0.6.2"

[tool.isort]
profile = "black"
Expand Down

0 comments on commit 3b4fde3

Please sign in to comment.