Skip to content

Avoid boot deadlock when first-run starts After= dependents #22

Avoid boot deadlock when first-run starts After= dependents

Avoid boot deadlock when first-run starts After= dependents #22

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: [main, dev]
permissions:
contents: read
jobs:
static:
name: shellcheck + syntax
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install shellcheck
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends shellcheck
- name: Run shellcheck and bash syntax check
run: |
mapfile -d '' shell_files < <(
while IFS= read -r -d '' file; do
if head -n 1 "$file" | grep -Eq '^#!.*(ba|z|da|)sh'; then
printf '%s\0' "$file"
fi
done < <(git ls-files -z)
)
if (( ${#shell_files[@]} )); then
shellcheck -S warning "${shell_files[@]}"
for file in "${shell_files[@]}"; do
bash -n "$file"
done
fi
- name: Run Python syntax check
run: |
python3 - <<'PY'
import ast
import pathlib
import subprocess
files = []
for raw in subprocess.check_output(["git", "ls-files", "-z"]).split(b"\0"):
if not raw:
continue
path = pathlib.Path(raw.decode())
first = path.open("rb").readline()
if path.suffix == ".py" or (first.startswith(b"#!") and b"python" in first):
files.append(path)
for path in files:
ast.parse(path.read_text(), filename=str(path))
print(f"checked {len(files)} Python file(s)")
PY
migrate-config-drift:
name: migrate-config drift vs airplanes-webconfig
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Diff vendored migrate-config.sh against airplanes-webconfig canonical copy
env:
CANONICAL_URL: https://raw.githubusercontent.com/airplanes-live/airplanes-webconfig/dev/helpers/migrate-config.sh
VENDORED_PATH: skeleton/usr/local/lib/airplanes-update/migrate-config.sh
run: |
curl -fsSL "$CANONICAL_URL" -o /tmp/canonical-migrate-config.sh
if ! diff -u /tmp/canonical-migrate-config.sh "$VENDORED_PATH"; then
echo "::error::Vendored migrate-config.sh drifted from airplanes-webconfig:dev canonical copy. Sync them."
exit 1
fi
rootfs-smoke:
name: update rootfs smoke
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install smoke dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends git make
- name: Run updater rootfs smoke
run: bash test/update-airplanes-rootfs-smoke.sh
- name: Run airplanes-first-run import call test
run: bash test/test-first-run-import-call.sh
image-release-rootfs-smoke:
name: image release rootfs smoke
runs-on: ubuntu-24.04
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install image smoke dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
jq \
make \
parted \
p7zip-full \
unzip \
xz-utils
- name: Run mounted release image smoke
env:
GITHUB_TOKEN: ${{ github.token }}
AIRPLANES_IMAGE_RELEASE_REPO: airplanes-live/image-releases
AIRPLANES_RELEASE_ROOTFS_WORK_DIR: ${{ runner.temp }}/airplanes-update-image-release-rootfs-smoke
run: |
sudo --preserve-env=GITHUB_TOKEN,AIRPLANES_IMAGE_RELEASE_REPO,AIRPLANES_RELEASE_ROOTFS_WORK_DIR \
bash test/image-release-rootfs-smoke.sh