scaffold: add project CI and Docker templates under templates/project/_shared; update proposal and plan to include them
Some checks failed
ci / test (push) Has been cancelled

This commit is contained in:
2025-09-17 11:08:45 -05:00
parent cf66c9a065
commit e1b3cd5634
8 changed files with 76 additions and 5 deletions

View File

@@ -0,0 +1,17 @@
name: ci
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build and run tests via Docker
run: |
docker compose -f docker/compose.yml up --build --abort-on-container-exit --remove-orphans
docker compose -f docker/compose.yml down -v --remove-orphans

View File

@@ -0,0 +1,19 @@
name: project
services:
tests:
build:
context: ..
dockerfile: docker/test/Dockerfile
container_name: project-tests
working_dir: /work
volumes:
- ..:/work:Z
command: ["/bin/bash", "-lc", "scripts/test.sh"]
networks:
- project-net
networks:
project-net:
name: project-net

View File

@@ -0,0 +1,11 @@
FROM debian:bookworm-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates git bash curl jq yq \
bats \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /work

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail
here="$(cd "$(dirname "$0")" && pwd)"
root="$(cd "$here/.." && pwd)"
compose_file="$root/docker/compose.yml"
echo "[docker] Running tests via docker compose"
docker compose -f "$compose_file" up --build --abort-on-container-exit --remove-orphans
docker compose -f "$compose_file" down -v --remove-orphans