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
33 changes: 0 additions & 33 deletions .ansible-lint

This file was deleted.

15 changes: 0 additions & 15 deletions .ansibleignore

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/ansible-role-ci.yml

This file was deleted.

24 changes: 16 additions & 8 deletions .github/workflows/application-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,36 @@ name: Application CI

on:
push:
branches:
- main
- develop
branches: [ main ]
pull_request:

jobs:
test:
ci:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install ruff mypy pytest

- name: Run tests
run: pytest
- name: Lint (ruff)
run: ruff check .

- name: Typecheck (mypy)
run: mypy app

- name: Test (pytest)
run: pytest -q

- name: Build container
run: docker build -t pi-log:ci .
11 changes: 0 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,3 @@ __pycache__/
# Pi-specific temp files
*.swp
*.swo

# ================================
# Ansible
# ================================
# Local facts, cache, and retry files
*.retry
.cache/
.fact_cache/
.ansible/
ansible/.ansible/
ansible/collections/
26 changes: 0 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,6 @@ repos:
- id: yamllint
args: ["-c", "yamllint.yml"]

# -----------------------------
# Ansible linting (pi-log)
# -----------------------------
- repo: https://github.com/ansible/ansible-lint
rev: v24.2.0
hooks:
- id: ansible-lint
name: ansible-lint (pi-log)
files: ^ansible/
stages: [commit]
additional_dependencies:
- ansible-core
- ansible
- ansible-lint
- ansible-compat
- ansible-pygments

- repo: local
hooks:
- id: install-ansible-collections
name: Install Ansible Galaxy collections for linting
entry: bash -c "ansible-galaxy collection install ansible.posix community.general"
language: system
pass_filenames: false
stages: [commit]

# -----------------------------
# Optional Python formatting
# -----------------------------
Expand Down
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# filename: Dockerfile
FROM python:3.11-slim

# Install OS packages needed for serial access
RUN apt-get update && apt-get install -y --no-install-recommends \
libudev1 \
&& rm -rf /var/lib/apt/lists/*

# Create app directory
WORKDIR /app

# Copy dependency list first for layer caching
COPY requirements.txt .

# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY . .

# Default command: run the ingestion agent
CMD ["python", "-m", "app.ingestion.geiger_reader"]

HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD python3 -c "import requests; requests.get('http://localhost:8080/health').raise_for_status()" || exit 1
Loading