-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
2,636 additions
and
1,275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
liberapay: janw | ||
ko_fi: janwxyz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: pip | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
labels: | ||
- dependencies | ||
commit-message: | ||
prefix: "build(deps)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Docker Build | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
docker-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get python version from file | ||
run: echo "PYTHON_VERSION=$(cat .python-version)" | tee -a "$GITHUB_ENV" | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: "ghcr.io/${{ github.repository }}" | ||
tags: | | ||
type=ref,event=pr | ||
type=semver,pattern=v{{major}} | ||
type=semver,pattern=v{{major}}.{{minor}} | ||
type=semver,pattern=v{{version}} | ||
type=raw,value=edge,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Github Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: linux/amd64 # TODO: add `linux/arm64/v8` | ||
build-args: | | ||
PYTHON_VERSION=${{ env.PYTHON_VERSION }} | ||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
pytest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get python version from file | ||
run: echo "PYTHON_VERSION=$(cat .python-version)" | tee -a "$GITHUB_ENV" | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up python environment | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
cache: 'poetry' | ||
|
||
- run: poetry install --no-root --with=tests --sync | ||
|
||
- run: poetry run pytest --cov --cov-report=xml --cov-report=term | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml | ||
name: coverage-${{ matrix.python-version }} | ||
if: always() | ||
|
||
- name: Upload coverage reports to Codeclimate | ||
uses: paambaati/codeclimate-action@v2.2.4 | ||
env: | ||
CC_TEST_REPORTER_ID: bfeb9df569119f2dfbf094be7ebff7f1c40ab30660d1cb949fc43c3c68618ee6 | ||
with: | ||
coverageLocations: | | ||
coverage.xml:coverage.py | ||
coverageCommand: yarn coverage | ||
if: always() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,34 @@ | ||
ci: | ||
autofix_prs: false | ||
autoupdate_schedule: quarterly | ||
autoupdate_commit_msg: 'build(deps): [pre-commit.ci] pre-commit autoupdate' | ||
|
||
exclude: > | ||
(?x)^( | ||
.+\.svg| | ||
.+/migrations/.+| | ||
.+/fixtures/.+| | ||
.+/cassettes/.+ | ||
)$ | ||
repos: | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: 'v0.0.267' | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: 'v0.1.14' | ||
hooks: | ||
- id: ruff | ||
args: [ --fix, --exit-non-zero-on-fix ] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: "23.3.0" | ||
hooks: | ||
- id: black | ||
|
||
- repo: local | ||
hooks: | ||
- id: python-no-print | ||
name: check for print() | ||
description: 'A quick check for the `print()` built-in function' | ||
entry: '\bprint\(' | ||
language: pygrep | ||
types: [python] | ||
|
||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: 'v1.10.0' | ||
hooks: | ||
- id: python-check-blanket-noqa | ||
- id: python-no-eval | ||
- id: ruff-format | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: 'v4.4.0' | ||
rev: 'v4.5.0' | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-builtin-literals | ||
- id: check-executables-have-shebangs | ||
- id: check-shebang-scripts-are-executable | ||
|
||
- repo: https://github.com/python-poetry/poetry | ||
rev: '1.4.2' | ||
rev: '1.7.1' | ||
hooks: | ||
- id: poetry-check | ||
- id: poetry-lock | ||
- id: poetry-export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.