Skip to content

Add official support for Java 21 (#1940) #341

Add official support for Java 21 (#1940)

Add official support for Java 21 (#1940) #341

Workflow file for this run

name: BATS
on:
push:
paths:
- 'tests/Dockerfile.*-BATS'
- 'functions/*.bats'
- 'functions/habapp.bash'
- 'functions/helpers.bash'
- 'functions/influxdb+grafana.bash'
- 'functions/java-jre.bash'
- 'functions/nodejs-apps.bash'
- 'functions/packages.bash'
- 'functions/vpn.bash'
- 'functions/zram.bash'
- '.github/workflows/bats-action.yml'
pull_request:
paths:
- 'tests/Dockerfile.*-BATS'
- 'functions/*.bats'
- 'functions/habapp.bash'
- 'functions/helpers.bash'
- 'functions/influxdb+grafana.bash'
- 'functions/java-jre.bash'
- 'functions/nodejs-apps.bash'
- 'functions/packages.bash'
- 'functions/vpn.bash'
- 'functions/zram.bash'
- '.github/workflows/bats-action.yml'
jobs:
bats-tests:
name: ${{ matrix.platform }} BATS
runs-on: ${{ matrix.runner }}
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
include:
- platform: amd64
runner: ubuntu-24.04
dockerfile: ./tests/Dockerfile.amd64-BATS
- platform: rpi4
runner: ubuntu-24.04-arm
dockerfile: ./tests/Dockerfile.rpi4-BATS
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup environment
run: sudo -E ./tests/ci-setup.bash github
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
with:
driver-opts: network=host
- name: Build Docker image
uses: docker/[email protected]
with:
context: .
file: ${{ matrix.dockerfile }}
builder: ${{ steps.buildx.outputs.name }}
tags: openhabian/${{ matrix.platform }}-openhabian:latest
load: true
- name: BATS tests on ${{ matrix.platform }} platform
run: |
docker run --rm --name "openhabian-${{ matrix.platform }}" -d 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-." .'
docker exec -i "openhabian-${{ matrix.platform }}" bash -c 'bats --tap --recursive --filter "destructive-." .'
docker stop "openhabian-${{ matrix.platform }}"