Skip to content

Commit

Permalink
Fixup actions and use newer base images
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <[email protected]>
  • Loading branch information
ecdye committed Oct 23, 2024
1 parent d571498 commit dc2a171
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 21 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/bats-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:
platform: [rpi4, amd64]
include:
- platform: rpi4
docker_platform: "--platform linux/arm64/v8"
docker_platform: "linux/arm64"
- platform: amd64
docker_platform: "linux/amd64"

steps:
- name: Checkout repository
Expand All @@ -65,6 +67,7 @@ jobs:
uses: docker/[email protected]
with:
driver-opts: network=host
platforms: ${{ matrix.docker_platform }}
- name: Build Docker image
uses: docker/[email protected]
with:
Expand All @@ -77,7 +80,7 @@ jobs:
push: true
- name: BATS tests on ${{ matrix.platform }} platform
run: |
docker run ${{ matrix.docker_platform }} --rm --name "openhabian-${{ matrix.platform }}" -d localhost:5000/openhabian/${{ matrix.platform }}-openhabian
docker run --platform ${{ matrix.docker_platform }} --rm --name "openhabian-${{ matrix.platform }}" -d localhost:5000/openhabian/${{ matrix.platform }}-openhabian
docker exec -i "openhabian-${{ matrix.platform }}" bash -c 'bats --tap --recursive --filter "development-." .'
docker exec -i "openhabian-${{ matrix.platform }}" bash -c 'bats --tap --recursive --filter "unit-." .'
docker exec -i "openhabian-${{ matrix.platform }}" bash -c 'bats --tap --recursive --filter "installation-." .'
Expand Down
32 changes: 18 additions & 14 deletions .github/workflows/installation-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,30 @@ jobs:

strategy:
matrix:
platform: [rpi3-64-zulujdk21, amd64-openjdk17, rpi3-openjdk17, rpi3-64-openjdk17]
platform: [rpi5-openjdk17, rpi3-openjdk17, amd64-openjdk17, rpi3-bellsoft21]
include:
- platform: rpi3-64-zulujdk21
dockerfile: ./tests/Dockerfile.rpi3-64-installation

- platform: rpi5-openjdk17
dockerfile: ./tests/Dockerfile.rpi5-installation
qemu_platform: arm64
java_opt: "Zulu21-64"
docker_platform: "--platform linux/arm64/v8"
- platform: amd64-openjdk17
dockerfile: ./tests/Dockerfile.amd64-installation
qemu_platform: ""
java_opt: "17"
docker_platform: "linux/arm64/v8"
- platform: rpi3-openjdk17
dockerfile: ./tests/Dockerfile.rpi3-installation
qemu_platform: arm
java_opt: "17"
docker_platform: "--platform linux/arm/v7"
- platform: rpi3-64-openjdk17
dockerfile: ./tests/Dockerfile.rpi3-64-installation
qemu_platform: arm64
docker_platform: "linux/arm/v7"
- platform: amd64-openjdk17
dockerfile: ./tests/Dockerfile.amd64-installation
qemu_platform: ""
java_opt: "17"
docker_platform: "--platform linux/arm64/v8"
docker_platform: "linux/amd64"
- platform: rpi3-bellsoft21
dockerfile: ./tests/Dockerfile.rpi3-installation
qemu_platform: arm
java_opt: "BellSoft21"
docker_platform: "linux/arm/v7"
continue-on-error: true # Experimental currently

steps:
- name: Checkout repository
Expand All @@ -78,6 +81,7 @@ jobs:
uses: docker/[email protected]
with:
driver-opts: network=host
platforms: ${{ matrix.docker_platform }}
- name: Build Docker image
uses: docker/[email protected]
with:
Expand All @@ -90,6 +94,6 @@ jobs:
push: true
- name: openHABian installation test with ${{ matrix.platform }}
run: |
docker run ${{ matrix.docker_platform }} --privileged --rm --name "openhabian-${{ matrix.platform }}" -d localhost:5000/openhabian/${{ matrix.platform }}
docker run --platform ${{ matrix.docker_platform }} --privileged --rm --name "openhabian-${{ matrix.platform }}" -d localhost:5000/openhabian/${{ matrix.platform }}
docker exec -i "openhabian-${{ matrix.platform }}" bash -c './build.bash local-test && /boot/first-boot.bash'
shell: bash
7 changes: 5 additions & 2 deletions functions/java-jre.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ java_install() {
java_alternatives_reset
rm -rf /opt/jdk
fi

openjdk_install_apt "$1"
if [[ $1 == "BellSoft21" ]]; then
liberica_install_apt
else
openjdk_install_apt "$1"
fi

if openhab_is_installed; then
cond_redirect systemctl restart openhab.service
Expand Down
2 changes: 1 addition & 1 deletion tests/Dockerfile.rpi3-installation
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Note RPi3 base (first RPi to have aarch64 available) WITH 32bit OS
# Note RPi3 base WITH 32bit OS for legacy (or soon to be) testing
FROM balenalib/raspberrypi3-debian:bookworm-build

Check warning on line 2 in tests/Dockerfile.rpi3-installation

View workflow job for this annotation

GitHub Actions / installation-tests (rpi3-openjdk17)

Base image platform does not match expected target platform

InvalidBaseImagePlatform: Base image balenalib/raspberrypi3-debian:bookworm-build was pulled with platform "linux/arm/v7", expected "linux/amd64" for current build

ENV DOCKER=1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Note RPi3 base (first RPi to have aarch64 available) WITH 64bit OS
FROM balenalib/raspberrypi3-64-debian:bookworm-build
FROM balenalib/raspberrypi5-debian:bookworm-build

ENV DOCKER=1
ENV UDEV=1
Expand Down

0 comments on commit dc2a171

Please sign in to comment.