Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-commit.ci #83

Merged
merged 3 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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