Skip to content
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 .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.4.3
current_version = 1.5.0
commit = False
tag = False

Expand Down
5 changes: 5 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Configuration related to self-hosted runner.
self-hosted-runner:
# Labels of self-hosted runner in array of strings.
labels:
- arc-runner-set
67 changes: 53 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,76 @@
on:
pull_request:
push:
branches-ignore:
- main

jobs:
test:
versiontag:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- uses: actions/checkout@v5
- name: Check version tag
run: |
curl -f https://raw.githubusercontent.com/pvarki/python-rasenmaeher-api/main/pyproject.toml -o /tmp/main_pyproject.toml || touch /tmp/main_pyproject.toml
grep "version = " pyproject.toml >/tmp/version.txt
grep "version = " /tmp/main_pyproject.toml >/tmp/main_version.txt
diff /tmp/main_version.txt /tmp/version.txt && exit 1 || exit 0

test:
runs-on: arc-runner-set
permissions:
contents: write
pull-requests: write
checks: write
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.11", "3.10"] # , "3.12"]
env:
PIP_INDEX_URL: https://nexus.dev.pvarki.fi/repository/python/simple
POETRY_PYPI_MIRROR_URL: https://nexus.dev.pvarki.fi/repository/python/simple
steps:
- uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v5
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry self add poetry-plugin-pypi-mirror
poetry install
- name: Do pre-commit checks (black, lint, mypy)
run: |
poetry run docker/pre_commit_init.sh
- name: Test with pytest
run: |
poetry run py.test -v
poetry run py.test -v --junitxml=pytest.xml
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/pytest*.xml'
detailed_summary: true
check_name: 'JUnit report (local)'

devel_shell:
runs-on: ubuntu-latest
docker_builds:
runs-on: arc-runner-set
steps:
- uses: pvarki/ci@main
with:
dockerfile-target: devel_shell
image-tag: multikeyjwt:devel_shell
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v5
with:
submodules: recursive
- name: Build test target
run: docker build --target test -t multikeyjwt:test .
- name: Build production target
run: docker build --target production -t multikeyjwt:production .
33 changes: 26 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3
default_install_hook_types:
- pre-commit
- commit-msg
repos:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.3.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: no-commit-to-branch
- id: check-executables-have-shebangs
Expand All @@ -22,29 +31,29 @@ repos:
args:
- --autofix
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 25.9.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.18.2
hooks:
- id: mypy
language: system
- repo: https://github.com/pycqa/pylint
rev: v2.17.5
rev: v4.0.1
hooks:
- id: pylint
language: system
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.0
rev: v1.5.5
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: forbid-tabs
- id: remove-tabs
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
rev: 1.8.6
hooks:
- id: bandit
args: ["--skip=B101"]
Expand All @@ -53,9 +62,19 @@ repos:
hooks:
- id: rst-linter
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
rev: v1.5.0
hooks:
- id: detect-secrets
language: system
exclude: "poetry\\.lock|tests/data/.*"
# args: ['--baseline', '.secrets.baseline']
- repo: https://github.com/rhysd/actionlint
rev: "v1.7.8"
hooks:
- id: actionlint
args: ["-shellcheck", "''"]
- repo: https://github.com/python-poetry/poetry
rev: '2.2.1'
hooks:
- id: poetry-check
- id: poetry-lock
6 changes: 3 additions & 3 deletions Dockerfile_alpine
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Tox testsuite for multiple python version #
#############################################
FROM advian/tox-base:alpine-3.19 as tox
ARG PYTHON_VERSIONS="3.11 3.10 3.9"
ARG POETRY_VERSION="2.0.1"
ARG PYTHON_VERSIONS="3.11 3.10"
ARG POETRY_VERSION="2.2.1"
RUN export RESOLVED_VERSIONS=`pyenv_resolve $PYTHON_VERSIONS` \
&& echo RESOLVED_VERSIONS=$RESOLVED_VERSIONS \
&& for pyver in $RESOLVED_VERSIONS; do pyenv install -s $pyver; done \
Expand Down Expand Up @@ -32,7 +32,7 @@ ENV \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
# poetry:
POETRY_VERSION=2.0.1
POETRY_VERSION=2.2.1


RUN apk add --no-cache \
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile_debian
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Tox testsuite for multiple python version #
#############################################
FROM advian/tox-base:debian-bookworm as tox
ARG PYTHON_VERSIONS="3.11 3.10 3.9"
ARG POETRY_VERSION="2.0.1"
ARG PYTHON_VERSIONS="3.11 3.10"
ARG POETRY_VERSION="2.2.1"
RUN export RESOLVED_VERSIONS=`pyenv_resolve $PYTHON_VERSIONS` \
&& echo RESOLVED_VERSIONS=$RESOLVED_VERSIONS \
&& for pyver in $RESOLVED_VERSIONS; do pyenv install -s $pyver; done \
Expand Down Expand Up @@ -33,7 +33,7 @@ ENV \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
# poetry:
POETRY_VERSION=2.0.1
POETRY_VERSION=2.2.1


RUN apt-get update && apt-get install -y \
Expand Down
Loading