Skip to content

Commit

Permalink
initial setup
Browse files Browse the repository at this point in the history
  • Loading branch information
kstathou committed Dec 2, 2023
1 parent 41773be commit c9789dd
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/actions/poetry/pre-commit-lint/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Run Lint
description: Run linters to verify code quality. Credits to Andre Sionek for writing the original GitHub Action.

runs:
using: "composite"
steps:
- name: Lint
shell: bash
run: poetry run pre-commit run --all-files
42 changes: 42 additions & 0 deletions .github/actions/poetry/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Set Up Poetry Environment
description: Install Python and Poetry. Credits to Andre Sionek for writing the original GitHub Action.

inputs:
python_version:
description: Python version
required: true
default: '3.11.5'
type: string

poetry_version:
description: Poetry version
required: true
default: 1.5.1
type: string

runs:
using: "composite"
steps:

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
version: ${{ inputs.poetry_version }}

- name: Set up Poetry cache
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}
cache: poetry

- name: Install Python Dependencies with Poetry
shell: bash
run: poetry install
31 changes: 31 additions & 0 deletions .github/workflows/status-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Status Checks

on:
push:
branches-ignore:
- main

# Stops the currently running workflow if a new one has been triggered
concurrency:
group: "${{ github.ref }}"
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- name: Set up
uses: ./.github/actions/poetry/setup
with:
python_version: "3.11.5"

- name: Install Python Lint Dependencies with Poetry
shell: bash
run: poetry install --with lint

- name: Lint
uses: ./.github/actions/poetry/pre-commit-lint
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST

.DS_Store
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down
31 changes: 31 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
extends: default

rules:
braces:
level: error
max-spaces-inside: 1
brackets:
level: error
max-spaces-inside: 1
colons:
level: error
commas:
level: error
empty-lines:
level: error
hyphens:
level: error
document-start: disable
indentation:
level: error
indent-sequences: consistent
new-lines:
level: warning
trailing-spaces:
level: warning
line-length:
max: 159
level: error
allow-non-breakable-inline-mappings: true
truthy: disable

0 comments on commit c9789dd

Please sign in to comment.