diff --git a/.github/workflows/test-artifacts.yml b/.github/workflows/test-artifacts.yml index 7c61db5..a82a466 100644 --- a/.github/workflows/test-artifacts.yml +++ b/.github/workflows/test-artifacts.yml @@ -2,7 +2,9 @@ name: Test Build Artifacts (Reusable) on: workflow_call: - workflow_dispatch: + +permissions: + contents: read jobs: test-artifact: @@ -42,7 +44,7 @@ jobs: if: matrix.format != 'rpm' run: | sudo apt-get update - sudo apt-get install -y file libfuse2 + sudo apt-get install -y file libfuse2 nodejs npm - name: Run artifact tests run: | diff --git a/tests/test-artifact-common.sh b/tests/test-artifact-common.sh index 7796b5b..4424d32 100644 --- a/tests/test-artifact-common.sh +++ b/tests/test-artifact-common.sh @@ -6,12 +6,12 @@ _fail_count=0 pass() { printf '[PASS] %s\n' "$*" - _pass_count=$((_pass_count + 1)) + ((_pass_count++)) } fail() { printf '[FAIL] %s\n' "$*" >&2 - _fail_count=$((_fail_count + 1)) + ((_fail_count++)) } assert_file_exists() { diff --git a/tests/test-artifact-deb.sh b/tests/test-artifact-deb.sh index ea55a38..146be9c 100644 --- a/tests/test-artifact-deb.sh +++ b/tests/test-artifact-deb.sh @@ -17,19 +17,19 @@ pass "Found deb: $(basename "$deb_file")" # --- Package metadata --- pkg_info=$(dpkg-deb -I "$deb_file") -if echo "$pkg_info" | grep -q 'Package: claude-desktop'; then +if [[ $pkg_info == *'Package: claude-desktop'* ]]; then pass "Package name is claude-desktop" else fail "Package name is not claude-desktop" fi -if echo "$pkg_info" | grep -q 'Architecture: amd64'; then +if [[ $pkg_info == *'Architecture: amd64'* ]]; then pass "Architecture is amd64" else fail "Architecture is not amd64" fi -if echo "$pkg_info" | grep -q 'Version:'; then +if [[ $pkg_info == *'Version:'* ]]; then pass "Version field present" else fail "Version field missing" @@ -37,7 +37,7 @@ fi # --- Install the package --- # Use --force-depends since we only care about file placement -if sudo dpkg -i --force-depends "$deb_file" 2>&1; then +if sudo dpkg -i --force-depends "$deb_file"; then pass "dpkg -i succeeded" else fail "dpkg -i failed" diff --git a/tests/test-artifact-rpm.sh b/tests/test-artifact-rpm.sh index d3cb0f2..60b2a3a 100644 --- a/tests/test-artifact-rpm.sh +++ b/tests/test-artifact-rpm.sh @@ -17,14 +17,14 @@ pass "Found rpm: $(basename "$rpm_file")" # --- RPM metadata --- rpm_info=$(rpm -qip "$rpm_file" 2>/dev/null) -if echo "$rpm_info" | grep -q 'Name.*claude-desktop'; then +if [[ $rpm_info =~ Name.*claude-desktop ]]; then pass "Package name is claude-desktop" else fail "Package name is not claude-desktop" fi # --- Install --- -if rpm -ivh --nodeps "$rpm_file" 2>&1; then +if rpm -ivh --nodeps "$rpm_file"; then pass "rpm -ivh succeeded" else fail "rpm -ivh failed"