Skip to content

build and test countdown #20

build and test countdown

build and test countdown #20

Workflow file for this run

name: build and test countdown
run-name: build and test countdown
on:
schedule:
- cron: "0 0 1 * *"
workflow_dispatch:
jobs:
build:
permissions:
contents: read
packages: write
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04
steps:
- name: Remove unwanted stuff
uses: gbraad-devenv/remove-unwanted@v1
- name: Check out repository code
uses: actions/checkout@v4
- name: Run podman build
run: podman build -t countdown-test -f Containerfile .
- name: Run system container with `podman`
run: |
podman run -d --name countdown --systemd=always --cap-add=NET_RAW --cap-add=NET_ADMIN --device=/dev/net/tun countdown-test
- name: Tailscale setup (root)
run: |
until podman exec countdown tailscale up --auth-key ${TAILSCALE_AUTHKEY} --hostname code-${HOSTNAME}
do
sleep 0.1
done
podman exec countdown tailscale set --ssh
env:
TAILSCALE_AUTHKEY: ${{ secrets.TAILSCALE_AUTHKEY}}
- name: Hang around until countdown
run: |
podman exec -d countdown code serve-web --without-connection-token
sleep 15
podman exec countdown tailscale serve --bg 8000
podman exec countdown systemctl start countdown.timer
until ! podman exec countdown systemctl is-active --quiet countdown.timer
do
sleep 10
done
sleep 60
podman exec countdown systemctl poweroff
echo "Finished by reaching countdown"