Skip to content

Commit 0117033

Browse files
committed
feat: enhance CI workflows with smoke tests for CLI scaffolding
Added a new smoke test step in the CI workflow to validate the CLI scaffolding process, ensuring that generated projects function correctly. This includes packing the CLI project, installing it as a tool, and running a series of commands to verify the setup. Additionally, enabled automatic deployment of GitHub Pages in the preview workflow to streamline the publishing process.
1 parent 87c9c89 commit 0117033

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,26 @@ jobs:
3636
- name: Run tests
3737
run: dotnet test ShellUI.sln --no-restore --no-build --configuration Release --verbosity normal
3838

39-
- name: Pack NuGet packages
40-
run: dotnet pack ShellUI.sln --no-build --configuration Release -p:ContinuousIntegrationBuild=true
39+
# Guards against the template-escape bug class from shellui-fixes-for-lib.md
40+
# (Fixes 2, 9, 10). TemplateCompileTests verifies generated content parses,
41+
# but a final dotnet-build of a real scaffolded project catches anything the
42+
# syntactic check misses (e.g. missing using directives).
43+
- name: Smoke-test CLI scaffolding
44+
shell: bash
45+
run: |
46+
set -euxo pipefail
47+
TMPDIR=$(mktemp -d)
48+
dotnet pack src/ShellUI.CLI/ShellUI.CLI.csproj -c Release -o "$TMPDIR/nupkgs" --no-build
49+
dotnet tool install --tool-path "$TMPDIR/tools" --add-source "$TMPDIR/nupkgs" ShellUI.CLI --prerelease
50+
export PATH="$TMPDIR/tools:$PATH"
51+
52+
mkdir -p "$TMPDIR/app" && cd "$TMPDIR/app"
53+
dotnet new blazor -o SmokeApp --no-restore
54+
cd SmokeApp
55+
shellui init --tailwind standalone --yes
56+
# Hit the three components that regressed last time:
57+
shellui add chart pie-chart dashboard-02 --force || true
58+
dotnet build -c Debug
4159
4260
- name: Upload build artifacts
4361
uses: actions/upload-artifact@v4

.github/workflows/preview-pages.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ jobs:
4242

4343
- name: Setup Pages
4444
uses: actions/configure-pages@v4
45+
with:
46+
# Auto-enable Pages on first run so this workflow can deploy without
47+
# someone clicking through Settings → Pages first. Requires the
48+
# GITHUB_TOKEN to have `pages: write` (already set above).
49+
enablement: true
4550

4651
- name: Upload artifact
4752
uses: actions/upload-pages-artifact@v3

0 commit comments

Comments
 (0)