Skip to content

Commit

Permalink
Run docker images on bookworm
Browse files Browse the repository at this point in the history
  • Loading branch information
s-martin committed Oct 16, 2023
1 parent 0079ff6 commit 4603106
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/docker_bookworm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Test Install Scripts for Bookworm on Docker

on:
schedule:
# run at 5 every sunday
- cron: '0 5 * * 0'
push:
branches-ignore:
- 'future3/**'
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.0.0

- name: Build Bookworm ARMv7
uses: docker/build-push-action@v5
with:
context: .
load: true
push: false
file: ./ci/Dockerfile.bookworm.test_install.armv7
platforms: linux/arm/v7
tags: rpi-jukebox-rfid-bookworm:latest
cache-from: type=gha,scope=$GITHUB_REF_NAME-bookworm
cache-to: type=gha,mode=max,scope=$GITHUB_REF_NAME-bookworm

- name: Run run_installation_tests.sh Bookworm ARMv7
uses: tj-actions/docker-run@v2
with:
image: rpi-jukebox-rfid-bookworm:latest
name: bookworm_run_installation_tests.sh
options: --platform linux/arm/v7
args: |
/code/scripts/installscripts/tests/run_installation_tests.sh
- name: Run run_installation_tests2.sh Bookworm ARMv7
uses: tj-actions/docker-run@v2
with:
image: rpi-jukebox-rfid-bookworm:latest
name: bookworm_run_installation_tests2.sh
options: --platform linux/arm/v7
args: |
/code/scripts/installscripts/tests/run_installation_tests2.sh
- name: Run run_installation_tests3.sh Bookworm ARMv7
uses: tj-actions/docker-run@v2
with:
image: rpi-jukebox-rfid-bookworm:latest
name: bookworm_run_installation_tests3.sh
options: --platform linux/arm/v7
args: |
/code/scripts/installscripts/tests/run_installation_tests3.sh
37 changes: 37 additions & 0 deletions ci/Dockerfile.bookworm.test_install.armv7
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM --platform=linux/arm/v7 arm32v7/debian:bookworm-slim
ENV DOCKER_RUNNING=true
ENV USER=pi

COPY . /code
WORKDIR /code

RUN groupadd --gid 1000 $USER ;\
useradd -u 1000 -g 1000 -G sudo -d /home/$USER -m -s /bin/bash -p '$1$iV7TOwOe$6ojkJQXyEA9bHd/SqNLNj0' $USER ;\
chown -R 1000:1000 /code /home/$USER ;\
chmod +x /code/scripts/installscripts/buster-install-default.sh ;\
chmod +x /code/scripts/installscripts/tests/run_installation_tests.sh ;\
chmod +x /code/scripts/installscripts/tests/run_installation_tests2.sh ;\
chmod +x /code/scripts/installscripts/tests/run_installation_tests3.sh

RUN export DEBIAN_FRONTEND=noninteractive ;\
apt-get update ;\
apt-get -y install curl gnupg sudo nano systemd apt-utils;\
echo 'deb http://raspbian.raspberrypi.org/raspbian/ bookworm main contrib non-free rpi' > /etc/apt/sources.list.d/raspi.list ;\
echo 'deb http://archive.raspberrypi.org/debian/ bookworm main' >> /etc/apt/sources.list.d/raspi.list ;\
curl http://raspbian.raspberrypi.org/raspbian.public.key | apt-key add - ;\
curl http://archive.raspberrypi.org/debian/raspberrypi.gpg.key | apt-key add - ;\
echo "$USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER ;\
apt-get clean ;\
rm -rf /var/cache/apt/* /var/lib/apt/lists/*

RUN export DEBIAN_FRONTEND=noninteractive ;\
apt-get update ;\
# install here to speed up GitHub Action
apt-get -y install raspberrypi-kernel raspberrypi-kernel-headers;\
apt-get -y dist-upgrade --auto-remove --purge ;\
apt-get -y install wget build-essential git iw locales wpasupplicant;\
apt-get clean ;\
touch /boot/cmdlinetxt ;\
rm -rf /var/cache/apt/* /var/lib/apt/lists/*

USER $USER

0 comments on commit 4603106

Please sign in to comment.