diff --git a/.github/actions/integrationtest/action.yml b/.github/actions/integrationtest/action.yml index 0ff6bae..5765a5a 100644 --- a/.github/actions/integrationtest/action.yml +++ b/.github/actions/integrationtest/action.yml @@ -32,6 +32,7 @@ runs: load: true tags: ${{ steps.meta-runtime.outputs.tags }} labels: ${{ steps.meta-runtime.outputs.labels }} + target: alexa-fhem cache-from: | type=gha,scope=verify_runtime_${{ inputs.PLATTFORM }} cache-to: type=gha,mode=max,scope=verify_runtime_${{ inputs.PLATTFORM }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9202d3a..2c5a3bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,6 +39,25 @@ jobs: PLATTFORM: linux/amd64 ALEXAFHEM_VERSION: ${{ steps.split_alexafhemV.outputs.result }} + - name: Build for bats with fhem base layer + uses: docker/build-push-action@v6.9.0 + id: docker_build_bats + with: + context: . + load: true + file: ./Dockerfile + platforms: linux/amd64 + push: false + target: alexa-fhem-bats + cache-from: | + type=gha,scope=verify_runtime_linux/amd64 + tags: bats-withalexafhem + + - uses: Wandalen/wretry.action@v3.7.3 + name: Run bats unit and integration tests in bidge network mode + with: + attempt_limit: 3 + command: timeout 9m docker run --rm -e GITHUB_RUN_ID=$GITHUB_RUN_ID -v "${PWD}/src/tests/bats:/code" bats-withalexafhem:latest -T -t . published_build: runs-on: ubuntu-latest needs: test_build @@ -134,6 +153,8 @@ jobs: L_USAGE=${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/README.md L_VCS_URL=${{ github.server_url }}/${{ github.repository }}/ L_AUTHORS=${{ github.server_url }}/${{ github.repository }}/graphs/contributors + target: alexa-fhem + - name: Install cosign uses: sigstore/cosign-installer@v3.7.0 diff --git a/src/tests/bats/entry.bats b/src/tests/bats/entry.bats index a5c77a4..51c5d1b 100644 --- a/src/tests/bats/entry.bats +++ b/src/tests/bats/entry.bats @@ -146,7 +146,7 @@ teardown_file() { } -@test "Test update_config function update and add multipke keys" { +@test "Test update_config function update and add multiple keys" { prepare_user_environment move_configurations export DEBUG=false @@ -165,7 +165,6 @@ teardown_file() { run -0 update_config "${ALEXAFHEM_DIR}"/config.json echo "#" >&3 && cat "${ALEXAFHEM_DIR}"/config.json >&3 - assert_file_permission 755 "${ALEXAFHEM_DIR}"/config.json run -0 jq -e '.alexa.port == "4000"' "${ALEXAFHEM_DIR}"/config.json run -0 jq -e '.alexa.name == "myServer"' "${ALEXAFHEM_DIR}"/config.json run -0 jq -e '.alexa.ssl == "true"' "${ALEXAFHEM_DIR}"/config.json