Update nodejs-apps.bash #971
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: | |
rpi4-bats: | |
runs-on: ubuntu-latest | |
services: | |
registry: | |
image: registry:2 | |
ports: | |
- 5000:5000 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup environment | |
run: sudo -E ./tests/ci-setup.bash github | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3.0.0 | |
with: | |
platforms: arm64 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3.0.0 | |
with: | |
driver-opts: network=host | |
- name: Build Docker image | |
uses: docker/build-push-action@v5.1.0 | |
with: | |
context: . | |
file: ./tests/Dockerfile.rpi4-BATS | |
builder: ${{ steps.buildx.outputs.name }} | |
tags: localhost:5000/openhabian/rpi4-openhabian:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
push: true | |
- name: BATS tests on virtual 64bit RPi4 running Debian Bullseye | |
run: | | |
docker run --rm --name "openhabian-rpi4" -d localhost:5000/openhabian/rpi4-openhabian | |
docker exec -i "openhabian-rpi4" bash -c 'bats --tap --recursive --filter "development-." .' | |
docker exec -i "openhabian-rpi4" bash -c 'bats --tap --recursive --filter "unit-." .' | |
docker exec -i "openhabian-rpi4" bash -c 'bats --tap --recursive --filter "installation-." .' | |
docker exec -i "openhabian-rpi4" bash -c 'bats --tap --recursive --filter "destructive-." .' | |
docker stop "openhabian-rpi4" | |
shell: bash | |
amd64-bats: | |
runs-on: ubuntu-latest | |
services: | |
registry: | |
image: registry:2 | |
ports: | |
- 5000:5000 | |
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/setup-buildx-action@v3.0.0 | |
with: | |
driver-opts: network=host | |
- name: Build Docker image | |
uses: docker/build-push-action@v5.1.0 | |
with: | |
context: . | |
file: ./tests/Dockerfile.amd64-BATS | |
builder: ${{ steps.buildx.outputs.name }} | |
tags: localhost:5000/openhabian/amd64-openhabian:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
push: true | |
- name: BATS tests on generic Debian Bullseye 64bit | |
run: | | |
docker run --rm --name "openhabian-amd64" -d localhost:5000/openhabian/amd64-openhabian | |
docker exec -i "openhabian-amd64" bash -c 'bats --tap --recursive --filter "development-." .' | |
docker exec -i "openhabian-amd64" bash -c 'bats --tap --recursive --filter "unit-." .' | |
docker exec -i "openhabian-amd64" bash -c 'bats --tap --recursive --filter "installation-." .' | |
docker exec -i "openhabian-amd64" bash -c 'bats --tap --recursive --filter "destructive-." .' | |
docker stop "openhabian-amd64" | |
shell: bash |