Fixup to make sure OH5 checks for Java 21 #1282
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: BATS | |
on: | |
push: | |
paths: | |
- 'tests/Dockerfile.*-BATS' | |
- 'functions/*.bats' | |
- 'functions/*.bash' | |
- '!functions/wifi.bash' | |
- '!functions/system.bash' | |
- '!functions/openhab.bash' | |
- '!functions/openhabian.bash' | |
- '!functions/menu.bash' | |
- '!functions/find.bash' | |
- '!functions/ext-storage.bash' | |
- '!functions/config.bash' | |
- '!functions/backup.bash' | |
- '!functions/auth.bash' | |
- '.github/workflows/bats-action.yml' | |
pull_request: | |
paths: | |
- 'tests/Dockerfile.*-BATS' | |
- 'functions/*.bats' | |
- 'functions/*.bash' | |
- '!functions/wifi.bash' | |
- '!functions/system.bash' | |
- '!functions/openhab.bash' | |
- '!functions/openhabian.bash' | |
- '!functions/menu.bash' | |
- '!functions/find.bash' | |
- '!functions/ext-storage.bash' | |
- '!functions/config.bash' | |
- '!functions/backup.bash' | |
- '!functions/auth.bash' | |
- '.github/workflows/bats-action.yml' | |
jobs: | |
bats-tests: | |
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 | |
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 | |
uses: actions/checkout@v4 | |
- name: Setup environment | |
run: sudo -E ./tests/ci-setup.bash github | |
- name: Set up QEMU | |
if: ${{ matrix.platform == 'rpi4' }} | |
uses: docker/[email protected] | |
with: | |
platforms: arm64 | |
- 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: ./tests/Dockerfile.${{ matrix.platform }}-BATS | |
builder: ${{ steps.buildx.outputs.name }} | |
tags: openhabian/${{ matrix.platform }}-openhabian:latest | |
platforms: ${{ matrix.buildx_platform }} | |
load: true | |
- name: BATS tests on ${{ matrix.platform }} platform | |
run: | | |
docker run --rm --name "openhabian-${{ matrix.platform }}" --platform ${{ matrix.buildx_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 }}" | |
shell: bash |