Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/install-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Install Test
permissions:
contents: read
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
jobs:
# CI builds this module on every push but has never installed it, and a build cannot observe an
# install-time break - a RequiredModules entry naming a version that does not exist, or a
# dependency that was dropped from the manifest but is still needed. This workflow publishes the
# built module into a temporary file-share repository alongside mirrored copies of its required
# modules and then, in a process whose PSModulePath holds only an empty directory, saves and
# imports it. See psake/PowerShellBuild#229.
#
# It runs alongside the shared ModuleCI.yml call in test.yml rather than inside it, because the
# shared workflow is used by the whole psake organization and this check is specific to this
# repository for now.
#
# Both jobs run on windows-latest so that the same runner can host a real Windows PowerShell 5.1
# engine as well as PowerShell 7. What the test does and does not prove is documented at the top
# of tests/InstallTime/Invoke-LocalRepositoryInstallTest.ps1 - read that before treating a green
# run here as broader coverage than it is.
local-repository-install:
name: Local repository install (${{ matrix.editionName }})
runs-on: windows-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- editionName: PowerShell 7
probeEdition: PowerShell7
- editionName: Windows PowerShell 5.1
probeEdition: WindowsPowerShell
steps:
- uses: actions/checkout@v7

# The build and the publish are the same work for either edition, so this step always runs
# on PowerShell 7; only the isolated probe process runs on the edition under test.
- name: Install from a local repository
shell: pwsh
run: ./tests/InstallTime/Invoke-LocalRepositoryInstallTest.ps1 -ProbeEdition ${{ matrix.probeEdition }}
4 changes: 4 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
],
"words": [
"Authenticode",
"coreclr",
"fullclr",
"LASTEXITCODE",
"psake",
"PSHOME",
"MAML"
],
"ignoreWords": [
Expand Down
17 changes: 17 additions & 0 deletions instructions/repository-specific.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
│ ├── psakeFile.ps1 # Tasks consumers import
│ └── IB.tasks.ps1 # Invoke-Build entry (aliased as PowerShellBuild.IB.Tasks)
├── tests/ # Pester 6+ tests
│ ├── InstallTime/ # Local-repository install test (CI only; not Pester)
│ └── TestModule/ # Sample module exercised by the test suite
├── build.ps1 # Main build entry point for THIS repo
├── build.settings.ps1 # Build settings for THIS repo's own psake build
Expand Down Expand Up @@ -288,11 +289,27 @@
`./build.ps1 -Task Test -Bootstrap` across a `ubuntu-latest`, `windows-latest`, `macOS-latest`
matrix on PowerShell 7 and again on Windows PowerShell 5.1, and publishes the test results

### Install test workflow (`.github/workflows/install-test.yml`)

- Triggers: push to `main`, pull requests, manual dispatch
- Runs on: `windows-latest`, once with a PowerShell 7 probe and once with a Windows
PowerShell 5.1 probe
- Repository-local rather than part of the shared workflow, because the coverage is specific to
this repository for now (psake/PowerShellBuild#229)
- Runs `tests/InstallTime/Invoke-LocalRepositoryInstallTest.ps1`, which publishes the built
module into a temporary file-share repository alongside mirrored copies of its
`RequiredModules`, then saves and imports it in a process whose `PSModulePath` holds only an
empty directory. A build cannot observe an install-time break; this can
Comment on lines +299 to +302
- Includes a negative control that republishes the module with an unsatisfiable dependency and
requires the save to fail, so a green run is evidence rather than an assumption
- The comment-based help at the top of that script records what the test deliberately does not
cover — read it before treating a green run as broader coverage than it is

### Publish workflow (`.github/workflows/publish.yaml`)

- Triggers: manual dispatch, GitHub release published
- Runs on: `ubuntu-latest`
- Reads `PSGALLERY_API_KEY` secret, converts to `PSCredential`, runs

Check warning on line 312 in instructions/repository-specific.instructions.md

View workflow job for this annotation

GitHub Actions / CI / Run Linters

Unknown word (PSGALLERY) Suggestions: (psaltery, spaller, psaltry, psalter, psalters)
`./build.ps1 -Task Publish -PSGalleryApiKey $cred -Bootstrap`

## Repo-Specific Conventions
Expand Down Expand Up @@ -373,9 +390,9 @@
| ------------------------- | ---------------------------------------------------- |
| `$env:BHProjectPath` | Repository root directory |
| `$env:BHProjectName` | Module name (from directory structure) |
| `$env:BHPSModulePath` | Path to module source directory |

Check warning on line 393 in instructions/repository-specific.instructions.md

View workflow job for this annotation

GitHub Actions / CI / Run Linters

Unknown word (BHPS) Suggestions: (baps, bops, bhp, BHP, bps)
| `$env:BHPSModuleManifest` | Path to `.psd1` manifest |

Check warning on line 394 in instructions/repository-specific.instructions.md

View workflow job for this annotation

GitHub Actions / CI / Run Linters

Unknown word (BHPS) Suggestions: (baps, bops, bhp, BHP, bps)
| `$env:BHModulePath` | Same as `BHPSModulePath` |

Check warning on line 395 in instructions/repository-specific.instructions.md

View workflow job for this annotation

GitHub Actions / CI / Run Linters

Unknown word (BHPS) Suggestions: (baps, bops, bhp, BHP, bps)
| `$env:BHBuildSystem` | Detected CI system (e.g., `GitHubActions`, `Unknown`)|
| `$env:BHBranchName` | Current git branch |
| `$env:BHCommitMessage` | Latest git commit message |
Expand Down
Loading
Loading