diff --git a/.github/workflows/bats-action.yml b/.github/workflows/bats-action.yml index 0ce973200..eeb50aa1a 100644 --- a/.github/workflows/bats-action.yml +++ b/.github/workflows/bats-action.yml @@ -47,6 +47,13 @@ jobs: strategy: matrix: platform: [rpi4, amd64] + include: + - platform: rpi4 + buildx_platform: linux/arm64 + continue-on-error: true # We want to test platforms independently + - platform: amd64 + buildx_platform: linux/amd64 + continue-on-error: true # We want to test platforms independently steps: - name: Checkout repository @@ -70,12 +77,13 @@ jobs: file: ./tests/Dockerfile.${{ matrix.platform }}-BATS builder: ${{ steps.buildx.outputs.name }} tags: localhost:5000/openhabian/${{ matrix.platform }}-openhabian:latest + platforms: ${{ matrix.buildx_platform }} cache-from: type=gha cache-to: type=gha,mode=max push: true - name: BATS tests on ${{ matrix.platform }} platform run: | - docker run --rm --name "openhabian-${{ matrix.platform }}" -d localhost:5000/openhabian/${{ matrix.platform }}-openhabian + docker run --rm --name "openhabian-${{ matrix.platform }}" --platform ${{ matrix.buildx_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-." .' diff --git a/.github/workflows/installation-action.yml b/.github/workflows/installation-action.yml index 97f0d2171..9ff7af325 100644 --- a/.github/workflows/installation-action.yml +++ b/.github/workflows/installation-action.yml @@ -40,25 +40,34 @@ jobs: strategy: matrix: - platform: [rpi5-openjdk17, rpi3-openjdk17, amd64-openjdk17, rpi3-bellsoft21] + platform: [rpi5-openjdk17, rpi3-openjdk17, amd64-openjdk17, rpi5-openjdk21, rpi5-temurin21] include: - - platform: rpi5-openjdk17 dockerfile: ./tests/Dockerfile.rpi5-installation qemu_platform: arm64 + buildx_platform: linux/arm64 java_opt: "17" - platform: rpi3-openjdk17 dockerfile: ./tests/Dockerfile.rpi3-installation qemu_platform: arm + buildx_platform: linux/arm/v7 java_opt: "17" - platform: amd64-openjdk17 dockerfile: ./tests/Dockerfile.amd64-installation qemu_platform: "" + buildx_platform: linux/amd64 java_opt: "17" - - platform: rpi3-bellsoft21 - dockerfile: ./tests/Dockerfile.rpi3-installation - qemu_platform: arm - java_opt: "BellSoft21" + - platform: rpi5-openjdk21 + dockerfile: ./tests/Dockerfile.rpi5-installation + qemu_platform: arm64 + buildx_platform: linux/arm64 + java_opt: "21" + continue-on-error: true # Experimental currently + - platform: rpi5-temurin21 + dockerfile: ./tests/Dockerfile.rpi5-installation + qemu_platform: arm64 + buildx_platform: linux/arm64 + java_opt: "Temurin21" continue-on-error: true # Experimental currently steps: @@ -87,9 +96,10 @@ jobs: tags: localhost:5000/openhabian/${{ matrix.platform }}:latest cache-from: type=gha cache-to: type=gha,mode=max + platforms: ${{ matrix.buildx_platform }} push: true - name: openHABian installation test with ${{ matrix.platform }} run: | - docker run --privileged --rm --name "openhabian-${{ matrix.platform }}" -d localhost:5000/openhabian/${{ matrix.platform }} + docker run --privileged --rm --platform ${{ matrix.buildx_platform }} --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 diff --git a/functions/menu.bash b/functions/menu.bash index 0bb951a58..19481c546 100644 --- a/functions/menu.bash +++ b/functions/menu.bash @@ -220,7 +220,7 @@ show_main_menu() { "43 | Clean cache" "Clean the cache for openHAB" \ "44 | Nginx Proxy" "Setup reverse and forward web proxy" \ "45 | OpenJDK 17" "Install and activate OpenJDK 17 as Java provider (default)" \ - "45 | OpenJDK 21" "Install and activate OpenJDK 21 as Java provider (upcoming default)" \ + " | OpenJDK 21" "Install and activate OpenJDK 21 as Java provider (upcoming default)" \ " | Temurin 17" "Install and activate Temurin 17 as Java provider (default alternative)" \ " | Temurin 21" "Install and activate Temurin 21 as Java provider (upcoming alternative default)" \ " | OpenJDK 11" "Install and activate OpenJDK 11 as Java provider (legacy)" \ diff --git a/functions/nodejs-apps.bats b/functions/nodejs-apps.bats index 544869dc4..05a63bcdc 100644 --- a/functions/nodejs-apps.bats +++ b/functions/nodejs-apps.bats @@ -28,7 +28,7 @@ teardown_file() { echo -e "# ${COL_GREEN}$(timestamp) [openHABian] Frontail service is running.${COL_DEF}" >&3 } -@test "installation-zigbee2mqtt_install" { +@test "disabled-zigbee2mqtt_install" { echo -e "# ${COL_CYAN}$(timestamp) [openHABian] Zigbee2MQTT installation starting...${COL_DEF}" >&3 run zigbee2mqtt_setup "install" 3>&- if [ "$status" -ne 0 ]; then echo "$output" >&3; fi diff --git a/functions/openhab.bash b/functions/openhab.bash index 4e95ae122..056a4bb52 100644 --- a/functions/openhab.bash +++ b/functions/openhab.bash @@ -65,7 +65,7 @@ openhab_setup() { repo="deb [signed-by=/usr/share/keyrings/${keyName}.gpg] https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main" echo -n "$(timestamp) [openHABian] Beginning install of latest $ohPkgName release (stable repo)... " elif [[ $1 == "milestone" || $1 == "testing" ]]; then - introText="You are about to install or change to the latest milestone $ohPkgName build. Note this is openHAB 4!\\n\\nMilestones contain the latest features and is supposed to run stable, but if you experience bugs or incompatibilities, please help with enhancing openHAB by posting them on the community forum or by raising a GitHub issue in the proper place.\\n\\nPlease be aware that downgrading from a newer build is not supported!\\n\\nPlease consult with the documentation or community forum and be sure to take a full openHAB configuration backup first!" + introText="You are about to install or change to the latest milestone $ohPkgName build. Note this is openHAB 5!\\n\\nMilestones contain the latest features and is supposed to run stable, but if you experience bugs or incompatibilities, please help with enhancing openHAB by posting them on the community forum or by raising a GitHub issue in the proper place.\\n\\nPlease be aware that downgrading from a newer build is not supported!\\n\\nPlease consult with the documentation or community forum and be sure to take a full openHAB configuration backup first!" successText="The testing release of $ohPkgName is now installed on your system.\\n\\nPlease test the correct behavior of your setup. You might need to adapt your configuration, if available. If you made changes to the files in '/var/lib/${ohPkgName}' they were replaced, but you can restore them from backup files next to the originals.\\n\\nCheck the \"openHAB Release Notes\" and the official announcements to learn about additons, fixes and changes." repo="deb [signed-by=/usr/share/keyrings/${keyName}.gpg] https://openhab.jfrog.io/artifactory/openhab-linuxpkg testing main" echo -n "$(timestamp) [openHABian] Beginning install of latest $ohPkgName milestone build (testing repo)... " @@ -98,6 +98,14 @@ openhab_setup() { openhabVersion="${2:-$(apt-cache madison ${ohPkgName} | head -n 1 | cut -d'|' -f2 | xargs)}" if [[ -n $openhabVersion ]]; then installVersion="${ohPkgName}=${openhabVersion} ${ohPkgName}-addons=${openhabVersion}" + if dpkg --compare-versions "$installVersion" ge "5.0.0"; then + if [[ -n $INTERACTIVE ]]; then + if ! (whiptail --title "openHAB software change" --msgbox "openHAB 5 requires Java 21.\\n\\nPlease use menu option 45 to install Java 21." 20 80); then echo "CANCELED"; return 1; fi + else + echo "FAILED (openHAB 5 requires Java 21)" + return 1 + fi + fi else installVersion="${ohPkgName} ${ohPkgName}-addons" fi