Skip to content

Commit 28d8f65

Browse files
committed
Add smoke tests for Linux installation and release package processes
1 parent e8a6800 commit 28d8f65

File tree

5 files changed

+90
-0
lines changed

5 files changed

+90
-0
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ jobs:
7171
chmod +x eng/ci/docker-smoke.sh
7272
./eng/ci/docker-smoke.sh agentpowershell:linux-ci
7373
74+
- name: Linux install and release-package smoke
75+
run: |
76+
chmod +x eng/ci/linux-package-smoke.sh eng/ci/release-package-smoke.sh eng/ci/install-smoke.sh install.sh
77+
./eng/ci/linux-package-smoke.sh linux-x64
78+
7479
docker-windows:
7580
name: ci / docker / windows
7681
runs-on: windows-latest
@@ -82,6 +87,11 @@ jobs:
8287
run: |
8388
./eng/ci/docker-smoke.ps1 -ImageTag agentpowershell:windows-ci
8489
90+
- name: Linux install and release-package smoke
91+
shell: pwsh
92+
run: |
93+
./eng/ci/linux-package-smoke.ps1 -Rid linux-x64
94+
8595
docker-macos-note:
8696
name: ci / docker / macos-note
8797
runs-on: macos-latest

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ dotnet run --project src/AgentPowerShell.Cli -- policy validate default-policy.y
6060
- Pull requests and pushes to `main` and `master` run .NET build/test jobs on Windows, Linux, and macOS.
6161
- The CI matrix now also smoke-tests published install outputs, not just repo-local `dotnet` execution paths.
6262
- Docker smoke coverage runs on Linux and Windows GitHub-hosted runners. macOS runners only execute the direct .NET test matrix because hosted macOS runners do not expose a Docker daemon.
63+
- Linux-container smoke coverage now also exercises `install.sh` and the staged release-package layout on Linux and Windows runners.
6364
- Release tags use semantic versioning in the form `vMAJOR.MINOR.PATCH`.
6465
- Tagged releases publish packaged CLI + daemon artifacts and Linux multi-arch Docker images under the `a5c-ai` GitHub organization.
6566
- The nightly workflow publishes `edge` container images to `ghcr.io/a5c-ai/agentpowershell`.

eng/ci/linux-package-smoke.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
param(
2+
[string]$Rid = "linux-x64",
3+
[string]$SdkImage = "mcr.microsoft.com/dotnet/sdk:9.0"
4+
)
5+
6+
$ErrorActionPreference = "Stop"
7+
$repoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
8+
Set-Location $repoRoot
9+
10+
$containerCommand = "chmod +x install.sh eng/ci/install-smoke.sh eng/ci/release-package-smoke.sh && ./eng/ci/install-smoke.sh && ./eng/ci/release-package-smoke.sh $Rid"
11+
docker run --rm -v "${repoRoot}:/work" -w /work $SdkImage bash -lc $containerCommand
12+
exit $LASTEXITCODE

eng/ci/linux-package-smoke.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env sh
2+
set -eu
3+
4+
RID="${1:-linux-x64}"
5+
SDK_IMAGE="${SDK_IMAGE:-mcr.microsoft.com/dotnet/sdk:9.0}"
6+
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
7+
REPO_ROOT=$(CDPATH= cd -- "$SCRIPT_DIR/../.." && pwd)
8+
9+
docker run --rm \
10+
-v "$REPO_ROOT:/work" \
11+
-w /work \
12+
"$SDK_IMAGE" \
13+
bash -lc "chmod +x install.sh eng/ci/install-smoke.sh eng/ci/release-package-smoke.sh && ./eng/ci/install-smoke.sh && ./eng/ci/release-package-smoke.sh $RID"

eng/ci/release-package-smoke.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env sh
2+
set -eu
3+
4+
RID="${1:-linux-x64}"
5+
CONFIGURATION="${CONFIGURATION:-Release}"
6+
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
7+
REPO_ROOT=$(CDPATH= cd -- "$SCRIPT_DIR/../.." && pwd)
8+
DOTNET_BIN="${DOTNET_HOST_PATH:-}"
9+
WORK_ROOT="$REPO_ROOT/.artifacts/release-smoke/$RID"
10+
PACKAGE_ROOT="$WORK_ROOT/package"
11+
12+
cleanup() {
13+
rm -rf "$WORK_ROOT"
14+
}
15+
16+
trap cleanup EXIT INT TERM
17+
18+
if [ -z "$DOTNET_BIN" ]; then
19+
DOTNET_BIN="$(command -v dotnet || true)"
20+
fi
21+
if [ -z "$DOTNET_BIN" ]; then
22+
DOTNET_BIN="$HOME/.dotnet/dotnet"
23+
fi
24+
if [ ! -x "$DOTNET_BIN" ]; then
25+
echo "Unable to locate dotnet. Install the .NET 9 SDK or set DOTNET_HOST_PATH." >&2
26+
exit 1
27+
fi
28+
29+
rm -rf "$WORK_ROOT"
30+
mkdir -p "$PACKAGE_ROOT/daemon"
31+
32+
cd "$REPO_ROOT"
33+
"$DOTNET_BIN" restore agentpowershell.sln -r "$RID"
34+
"$DOTNET_BIN" publish src/AgentPowerShell.Cli/AgentPowerShell.Cli.csproj -c "$CONFIGURATION" -r "$RID" --self-contained true -p:PublishSingleFile=true --no-restore -o "$PACKAGE_ROOT"
35+
"$DOTNET_BIN" publish src/AgentPowerShell.Daemon/AgentPowerShell.Daemon.csproj -c "$CONFIGURATION" -r "$RID" --self-contained true -p:PublishSingleFile=true --no-restore -o "$PACKAGE_ROOT/daemon"
36+
37+
cp default-policy.yml "$PACKAGE_ROOT/default-policy.yml"
38+
cp config.yml "$PACKAGE_ROOT/config.yml"
39+
40+
CLI="$PACKAGE_ROOT/AgentPowerShell.Cli"
41+
DAEMON="$PACKAGE_ROOT/daemon/AgentPowerShell.Daemon"
42+
43+
test -x "$CLI"
44+
test -x "$DAEMON"
45+
test -f "$PACKAGE_ROOT/default-policy.yml"
46+
test -f "$PACKAGE_ROOT/config.yml"
47+
48+
export AGENTPOWERSHELL_DAEMON_PATH="$DAEMON"
49+
50+
"$CLI" version
51+
"$CLI" policy validate "$PACKAGE_ROOT/default-policy.yml" --output json
52+
"$CLI" start --output json
53+
"$CLI" status --output json
54+
"$CLI" stop --output json

0 commit comments

Comments
 (0)