Skip to content

Update workflow ignore patterns #50

Update workflow ignore patterns

Update workflow ignore patterns #50

Workflow file for this run

name: Run Podman Compose demos
on:
push:
branches: [ main ]
paths:
- '.github/workflows/main.yaml'
- 'demo/demo-1-basics/**'
- 'demo/demo-2-otel/**'
# FORCE IGNORE (The "!" must come AFTER the includes)
- '!README.md'
- '!README.MD'
- '!docs/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/main.yaml'
- 'demo/demo-1-basics/**'
- 'demo/demo-2-otel/**'
# FORCE IGNORE (The "!" must come AFTER the includes)
- '!README.md'
- '!README.MD'
- '!docs/**'
workflow_dispatch:
jobs:
podman-compose:
runs-on: ubuntu-latest
env:
XDG_RUNTIME_DIR: ${{ github.workspace }}/podman-runtime
TMPDIR: ${{ github.workspace }}/podman-tmp
PODMAN_STORAGE: ${{ github.workspace }}/podman-storage
steps:
# --------------------------------------------------
# 1️⃣ Checkout (Fetch 2 commits for comparison)
# --------------------------------------------------
- name: Checkout repository
uses: actions/checkout@v4
with:
# FORCE submodules to stay away
submodules: false
# Turn off the "smart" submodule features that are crashing
set-safe-directory: false
# Fetch only the top level, no history
fetch-depth: 1
clean: true
# --------------------------------------------------
# Checkout (Fetch 2 commits for comparison)
# --------------------------------------------------
- name: 🔍 DEBUG - Show Changed Files
run: |
echo "The following files changed in this push:"
git diff-tree --no-commit-id --name-only -r ${{ github.sha }}
echo "----------------------------------------"
echo "Checking if any match your inclusion paths:"
git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -E '^(.github/workflows/|demo/demo-1-basics/|demo/demo-2-otel/)' || echo "NO MATCHES FOUND"
# --------------------------------------------------
# 2️⃣ Free disk space
# --------------------------------------------------
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo docker image prune -a -f || true
df -h
# --------------------------------------------------
# 3️⃣ Install Podman & podman-compose
# --------------------------------------------------
- name: Install Podman & podman-compose
run: |
sudo apt-get update -y
sudo apt-get install -y podman uidmap python3-pip
pip install podman-compose
# --------------------------------------------------
# 4️⃣ Configure Podman runtime & storage
# --------------------------------------------------
- name: Configure Podman
run: |
mkdir -p ~/.config/containers "$XDG_RUNTIME_DIR" "$TMPDIR" "$PODMAN_STORAGE"
chmod 700 "$XDG_RUNTIME_DIR"
chmod 777 "$TMPDIR" "$PODMAN_STORAGE"
cat <<EOF > ~/.config/containers/containers.conf
[engine]
cgroup_manager = "cgroupfs"
runtime = "crun"
events_logger = "file"
systemd = false
log_level = "error"
EOF
cat <<EOF > ~/.config/containers/storage.conf
[storage]
driver = "overlay"
graphroot = "$PODMAN_STORAGE"
runroot = "$XDG_RUNTIME_DIR/runroot"
EOF
podman system migrate
# ==================================================
# 🔹 RUN DEMOS
# ==================================================
- name: Run demo-1-basics
working-directory: demo/demo-1-basics
run: |
podman network create anomaly-network || true
podman-compose up -d
podman ps
podman-compose down -v
- name: Run demo-2-otel
working-directory: demo/demo-2-otel
run: |
podman network create edge-network || true
podman-compose up -d
podman ps
- name: Final cleanup
if: always()
run: podman system prune -a -f