This commit is contained in:
+17
-10
@@ -15,17 +15,24 @@ jobs:
|
|||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
|
- name: Install test toolchain
|
||||||
with:
|
run: |
|
||||||
python-version: "3.12"
|
set -eu
|
||||||
cache: pip
|
apk add --no-cache curl python3 py3-pip
|
||||||
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
|
curl --fail --location --silent --show-error \
|
||||||
with:
|
--output /tmp/go1.27.1.linux-amd64.tar.gz \
|
||||||
go-version: "1.27.1"
|
https://go.dev/dl/go1.27.1.linux-amd64.tar.gz
|
||||||
- name: Install test dependencies
|
echo "63d339f0da5ab53635a56f2490a7984dfe12dfcff22ad749f63edaf590168445 /tmp/go1.27.1.linux-amd64.tar.gz" \
|
||||||
run: python -m pip install --requirement requirements-dev.txt
|
| sha256sum -c -
|
||||||
|
mkdir -p /opt/go1.27.1
|
||||||
|
tar --extract --gzip --file /tmp/go1.27.1.linux-amd64.tar.gz \
|
||||||
|
--directory /opt/go1.27.1 --strip-components 1
|
||||||
|
ln -sf /opt/go1.27.1/bin/go /usr/local/bin/go
|
||||||
|
go version
|
||||||
|
python3 -m venv .venv
|
||||||
|
.venv/bin/pip install --requirement requirements-dev.txt
|
||||||
- name: Validate metadata, patches, and process manager
|
- name: Validate metadata, patches, and process manager
|
||||||
run: pytest -q
|
run: .venv/bin/pytest -q
|
||||||
- name: Build amd64 image
|
- 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 buildx build --platform linux/amd64 --build-arg BUILD_ARCH=amd64 --load --tag homeassistant-stelloauth-addon:test stelloauth
|
||||||
- name: Exercise runtime
|
- name: Exercise runtime
|
||||||
|
|||||||
@@ -173,6 +173,34 @@ def test_ci_builds_and_loads_only_the_amd64_test_image() -> None:
|
|||||||
assert publication_primitive not in workflow
|
assert publication_primitive not in workflow
|
||||||
|
|
||||||
|
|
||||||
|
def test_ci_installs_toolchain_without_hosted_toolcache_actions() -> None:
|
||||||
|
workflow = (ROOT / ".gitea/workflows/ci.yml").read_text(encoding="utf-8")
|
||||||
|
parsed = yaml.safe_load(workflow)
|
||||||
|
steps = parsed["jobs"]["validate"]["steps"]
|
||||||
|
setup_command = next(
|
||||||
|
step["run"] for step in steps if step.get("name") == "Install test toolchain"
|
||||||
|
)
|
||||||
|
|
||||||
|
assert "actions/setup-python" not in workflow
|
||||||
|
assert "actions/setup-go" not in workflow
|
||||||
|
for required_command in (
|
||||||
|
"apk add --no-cache curl python3 py3-pip",
|
||||||
|
"go1.27.1.linux-amd64.tar.gz",
|
||||||
|
"63d339f0da5ab53635a56f2490a7984dfe12dfcff22ad749f63edaf590168445",
|
||||||
|
"sha256sum -c -",
|
||||||
|
"python3 -m venv .venv",
|
||||||
|
".venv/bin/pip install --requirement requirements-dev.txt",
|
||||||
|
):
|
||||||
|
assert required_command in setup_command
|
||||||
|
|
||||||
|
validation_command = next(
|
||||||
|
step["run"]
|
||||||
|
for step in steps
|
||||||
|
if step.get("name") == "Validate metadata, patches, and process manager"
|
||||||
|
)
|
||||||
|
assert validation_command == ".venv/bin/pytest -q"
|
||||||
|
|
||||||
|
|
||||||
def test_patch_payloads_disable_git_whitespace_errors() -> None:
|
def test_patch_payloads_disable_git_whitespace_errors() -> None:
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in New Issue
Block a user