From 77d95936f331bf63081ba28d6cd58dc6e6271a73 Mon Sep 17 00:00:00 2001 From: Mresyzz <283381851+Mresyzz@users.noreply.github.com> Date: Fri, 2 Oct 2026 16:39:13 +0800 Subject: [PATCH 1/7] ci: test installer compatibility across Linux distros --- .github/workflows/opsscript-gate.yml | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/opsscript-gate.yml diff --git a/.github/workflows/opsscript-gate.yml b/.github/workflows/opsscript-gate.yml new file mode 100644 index 00000000..e0a6802c --- /dev/null +++ b/.github/workflows/opsscript-gate.yml @@ -0,0 +1,54 @@ +name: Installer compatibility + +on: + pull_request: + paths: + - install.sh + - .github/workflows/opsscript-gate.yml + push: + branches: [main] + paths: + - install.sh + - .github/workflows/opsscript-gate.yml + +permissions: + contents: read + +jobs: + installer: + name: install.sh / ${{ matrix.image }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + image: + - debian:12-slim + - ubuntu:22.04 + - ubuntu:24.04 + - alpine:3.20 + + steps: + - name: Check out + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Check installer compatibility + uses: Mresyzz/opsscript-gate@v0.8.0 + with: + script-path: install.sh + matrix: ${{ matrix.image }} + network: bridge + packages: | + curl + ca-certificates + tar + output: reports/opsscript-gate-${{ matrix.image }}.json + + - name: Upload compatibility report + if: always() + uses: actions/upload-artifact@v4 + with: + name: opsscript-gate-${{ matrix.image }} + path: reports/ + if-no-files-found: ignore From a4374d4d9aa2f1d28678799b207ad7d9aafe505c Mon Sep 17 00:00:00 2001 From: Mresyzz <283381851+Mresyzz@users.noreply.github.com> Date: Fri, 2 Oct 2026 16:41:08 +0800 Subject: [PATCH 2/7] ci: allow manual installer compatibility runs --- .github/workflows/opsscript-gate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/opsscript-gate.yml b/.github/workflows/opsscript-gate.yml index e0a6802c..9c1bd5fe 100644 --- a/.github/workflows/opsscript-gate.yml +++ b/.github/workflows/opsscript-gate.yml @@ -1,6 +1,7 @@ name: Installer compatibility on: + workflow_dispatch: pull_request: paths: - install.sh From 620abb9bd4bd4e2afd1a38e4bcc2b77e2d48f3ed Mon Sep 17 00:00:00 2001 From: Mresyzz <283381851+Mresyzz@users.noreply.github.com> Date: Fri, 2 Oct 2026 16:41:48 +0800 Subject: [PATCH 3/7] ci: run installer check on validation branch --- .github/workflows/opsscript-gate.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/opsscript-gate.yml b/.github/workflows/opsscript-gate.yml index 9c1bd5fe..39642f57 100644 --- a/.github/workflows/opsscript-gate.yml +++ b/.github/workflows/opsscript-gate.yml @@ -7,7 +7,9 @@ on: - install.sh - .github/workflows/opsscript-gate.yml push: - branches: [main] + branches: + - main + - test/opsscript-gate-installer paths: - install.sh - .github/workflows/opsscript-gate.yml From 2fea046527fb7d8cc5ad8be78cf7c62fbd461bc7 Mon Sep 17 00:00:00 2001 From: Mresyzz <283381851+Mresyzz@users.noreply.github.com> Date: Fri, 2 Oct 2026 16:43:15 +0800 Subject: [PATCH 4/7] ci: use filesystem-safe compatibility artifact names --- .github/workflows/opsscript-gate.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/opsscript-gate.yml b/.github/workflows/opsscript-gate.yml index 39642f57..5a5d0549 100644 --- a/.github/workflows/opsscript-gate.yml +++ b/.github/workflows/opsscript-gate.yml @@ -24,11 +24,15 @@ jobs: strategy: fail-fast: false matrix: - image: - - debian:12-slim - - ubuntu:22.04 - - ubuntu:24.04 - - alpine:3.20 + include: + - image: debian:12-slim + id: debian-12-slim + - image: ubuntu:22.04 + id: ubuntu-22-04 + - image: ubuntu:24.04 + id: ubuntu-24-04 + - image: alpine:3.20 + id: alpine-3-20 steps: - name: Check out @@ -46,12 +50,12 @@ jobs: curl ca-certificates tar - output: reports/opsscript-gate-${{ matrix.image }}.json + output: reports/opsscript-gate-${{ matrix.id }}.json - name: Upload compatibility report if: always() uses: actions/upload-artifact@v4 with: - name: opsscript-gate-${{ matrix.image }} + name: opsscript-gate-${{ matrix.id }} path: reports/ if-no-files-found: ignore From ca2ab96a2dccd7dbf96abf82d0233987fd1808e7 Mon Sep 17 00:00:00 2001 From: Mresyzz <283381851+Mresyzz@users.noreply.github.com> Date: Fri, 2 Oct 2026 16:44:18 +0800 Subject: [PATCH 5/7] ci: keep installer check scoped to relevant changes --- .github/workflows/opsscript-gate.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/opsscript-gate.yml b/.github/workflows/opsscript-gate.yml index 5a5d0549..b7b8649c 100644 --- a/.github/workflows/opsscript-gate.yml +++ b/.github/workflows/opsscript-gate.yml @@ -1,15 +1,12 @@ name: Installer compatibility on: - workflow_dispatch: pull_request: paths: - install.sh - .github/workflows/opsscript-gate.yml push: - branches: - - main - - test/opsscript-gate-installer + branches: [main] paths: - install.sh - .github/workflows/opsscript-gate.yml From eaa41741fbf77af4f01a9ed81b2fd80fff5f59f8 Mon Sep 17 00:00:00 2001 From: Mresyzz <283381851+Mresyzz@users.noreply.github.com> Date: Sun, 11 Oct 2026 22:06:44 +0800 Subject: [PATCH 6/7] ci: verify installed binary and supply bash dependency --- .github/workflows/opsscript-gate.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/opsscript-gate.yml b/.github/workflows/opsscript-gate.yml index b7b8649c..cc341187 100644 --- a/.github/workflows/opsscript-gate.yml +++ b/.github/workflows/opsscript-gate.yml @@ -4,11 +4,13 @@ on: pull_request: paths: - install.sh + - .goreleaser.yaml - .github/workflows/opsscript-gate.yml push: branches: [main] paths: - install.sh + - .goreleaser.yaml - .github/workflows/opsscript-gate.yml permissions: @@ -37,13 +39,25 @@ jobs: with: persist-credentials: false + - name: Add installation postcondition + shell: bash + run: | + cat install.sh > installer-smoke.sh + cat >> installer-smoke.sh <<'EOF' + + # An installer exit code alone does not prove the binary was installed. + test -x "$HOME/.lsh/lsh" || { echo 'lsh was not installed' >&2; exit 1; } + "$HOME/.lsh/lsh" --version + EOF + - name: Check installer compatibility - uses: Mresyzz/opsscript-gate@v0.8.0 + uses: Mresyzz/opsscript-gate@v0.9.4 with: - script-path: install.sh + script-path: installer-smoke.sh matrix: ${{ matrix.image }} network: bridge packages: | + bash curl ca-certificates tar From 3afa715967a0baac2de586c4ff2de18ac4943e27 Mon Sep 17 00:00:00 2001 From: Mresyzz <283381851+Mresyzz@users.noreply.github.com> Date: Sun, 11 Oct 2026 22:14:31 +0800 Subject: [PATCH 7/7] ci: preserve installer exit and errexit behavior before binary check --- .github/workflows/opsscript-gate.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/opsscript-gate.yml b/.github/workflows/opsscript-gate.yml index cc341187..0749e66b 100644 --- a/.github/workflows/opsscript-gate.yml +++ b/.github/workflows/opsscript-gate.yml @@ -42,7 +42,11 @@ jobs: - name: Add installation postcondition shell: bash run: | - cat install.sh > installer-smoke.sh + { + printf '#!/bin/bash\n(\n' + cat install.sh + printf '\n)\ninstaller_status=$?\n[ "$installer_status" -eq 0 ] || exit "$installer_status"\n' + } > installer-smoke.sh cat >> installer-smoke.sh <<'EOF' # An installer exit code alone does not prove the binary was installed.