Files
restic-backup-docker/.github/workflows/test.yml
T
Tobias KaupatandClaude Opus 5 9f1c80951d ci: use the container-structure-test image instead of a pinned download
The pinned release URL returned 404. test/run.sh already falls back to the
official tool image when the binary is absent, so CI and local runs now take
the same path.

Also pin *.txt to LF and make the required-features lookup tolerate CRLF, so
the feature gate works on a Windows checkout too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Agent-Id: agent-7034f75b-1ddc-4aa1-a4ea-3a54b340e8d9
2026-10-17 22:50:15 +02:00

51 lines
1.6 KiB
YAML

name: Test
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install shellcheck
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq shellcheck
# The test scripts are new, so they are held to a clean bill of health.
- name: Run shellcheck on the test scripts
run: shellcheck --severity=warning test/*.sh
# The image scripts declare #!/bin/sh but use a few bash constructs that
# busybox ash happens to accept. Cleaning that up is a separate change,
# so this step reports but does not block.
- name: Run shellcheck on the image scripts
run: |
shellcheck --severity=warning backup.sh check.sh entry.sh build.sh run.sh \
|| echo "::warning::shellcheck reported findings in the image scripts, see the log above"
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build test image
run: docker build -t restic-backup-docker:test .
# container-structure-test is not installed: test/run.sh falls back to
# the official tool image, which keeps CI and local runs identical.
- name: Run test suites
run: bash test/run.sh --no-build
# Guards the guard: if someone waters the suites down until a broken
# backup no longer fails them, this step turns red.
- name: Verify the suite detects a broken backup
run: bash test/run.sh --sabotage