Skip to content

Ensure that files sync to disk on SystemD #328

Ensure that files sync to disk on SystemD

Ensure that files sync to disk on SystemD #328

Workflow file for this run

name: Test
# Trigger the workflow on push or pull request
on:
push:
paths:
- 'zram-config'
- 'ztab'
- '**.bash'
- 'tests/**'
- '.github/workflows/test-action.yml'
pull_request:
paths:
- 'zram-config'
- 'ztab'
- '**.bash'
- 'tests/**'
- '.github/workflows/test-action.yml'
jobs:
test:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup environment
run: |
sudo -E bash -c set
sudo apt-get update
sudo apt-get install --yes expect systemd-container qemu-user-static qemu-utils qemu-system-arm libfdt-dev binfmt-support
- name: Add custom stage
run: |
mkdir -p test-stage/00-install-packages &&
{
cat > test-stage/00-install-packages/00-packages <<-EOF
gcc meson libc6-dev
EOF
} &&
{
cat > test-stage/prerun.sh <<-EOF
#!/bin/bash -e
if [ ! -d "\${ROOTFS_DIR}" ]; then
copy_previous
fi
EOF
} &&
chmod +x test-stage/prerun.sh
- name: Build image
id: build
uses: usimd/[email protected]
with:
image-name: raspios
compression: none
pi-gen-version: master
verbose-output: true
stage-list: stage0 stage1 stage2 ./test-stage
- name: Build image
run: sudo -E ./tests/image.bash "setup" "${{ steps.build.outputs.image-path }}"
shell: bash
- name: Run tests
run: |
mv "${{ steps.build.outputs.image-path }}" raspios.img
sudo expect ./tests/run.exp
shell: bash
- name: Copy logs
if: always()
run: sudo ./tests/image.bash "copy-logs" "raspios.img"
- name: Upload logs
if: always()
uses: actions/upload-artifact@v4
with:
name: logs.tar.gz
path: logs.tar.gz