diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 28ce98e..2e674f6 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -15,11 +15,13 @@ jobs: timeout-minutes: 45 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: Validate runner architecture + run: test "$(uname -m)" = "x86_64" - name: Build validation image - run: docker buildx build --platform linux/amd64 --file tests/Dockerfile.ci --load --tag homeassistant-stelloauth-tests:test . + run: docker build --file tests/Dockerfile.ci --tag homeassistant-stelloauth-tests:test . - name: Validate metadata, patches, and process manager run: docker run --rm homeassistant-stelloauth-tests:test -q - name: Build amd64 image - run: docker buildx build --platform linux/amd64 --build-arg BUILD_ARCH=amd64 --load --tag homeassistant-stelloauth-addon:test stelloauth + run: docker build --build-arg TARGETARCH=amd64 --build-arg BUILD_ARCH=amd64 --tag homeassistant-stelloauth-addon:test stelloauth - name: Exercise runtime run: SKIP_BUILD=1 tests/test_runtime.sh diff --git a/tests/test_addon_metadata.py b/tests/test_addon_metadata.py index d3304ea..261438d 100644 --- a/tests/test_addon_metadata.py +++ b/tests/test_addon_metadata.py @@ -147,18 +147,20 @@ def test_ci_builds_and_loads_only_the_amd64_test_image() -> None: workflow = (ROOT / ".gitea/workflows/ci.yml").read_text(encoding="utf-8") parsed = yaml.safe_load(workflow) steps = parsed["jobs"]["validate"]["steps"] + architecture_command = next( + step["run"] for step in steps if step.get("name") == "Validate runner architecture" + ) + assert architecture_command == 'test "$(uname -m)" = "x86_64"' build_command = next( step["run"] for step in steps if step.get("name") == "Build amd64 image" ) assert build_command.split() == [ "docker", - "buildx", "build", - "--platform", - "linux/amd64", + "--build-arg", + "TARGETARCH=amd64", "--build-arg", "BUILD_ARCH=amd64", - "--load", "--tag", "homeassistant-stelloauth-addon:test", "stelloauth", @@ -184,13 +186,9 @@ def test_ci_runs_validation_in_pinned_container() -> None: ) assert build_command.split() == [ "docker", - "buildx", "build", - "--platform", - "linux/amd64", "--file", "tests/Dockerfile.ci", - "--load", "--tag", "homeassistant-stelloauth-tests:test", ".",