revert changes as this is in another PR #1951
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cross Platform Import | |
on: | |
push: | |
paths-ignore: | |
- '**/*.md' | |
- '**/*.json' | |
- '!.github/dbatools-library-version.json' | |
- 'docs/**' | |
- '.github/FUNDING.yml' | |
- '.github/ISSUE_TEMPLATE/**' | |
- '.github/PULL_REQUEST_TEMPLATE.md' | |
- '.aider/**' | |
- '.devcontainer/**' | |
- '.vscode/**' | |
- 'bin/**' | |
- 'en-us/**' | |
jobs: | |
build: | |
env: | |
SMODefaultModuleName: dbatools | |
name: Module imports on all platforms | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest, macOS-14] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Show pwsh version | |
shell: pwsh | |
run: pwsh --version | |
- name: Read dbatools.library version | |
id: get-version | |
shell: pwsh | |
run: | | |
$versionConfig = Get-Content '.github/dbatools-library-version.json' | ConvertFrom-Json | |
$version = $versionConfig.version | |
$isPreview = $version -like "*preview*" | |
Write-Output "version=$version" >> $env:GITHUB_OUTPUT | |
Write-Output "is_preview=$isPreview" >> $env:GITHUB_OUTPUT | |
Write-Output "Using dbatools.library version: $version" | |
Write-Output "Is preview version: $isPreview" | |
- name: Install and cache PowerShell modules (stable versions) | |
if: steps.get-version.outputs.is_preview == 'False' | |
uses: potatoqualitee/[email protected] | |
with: | |
modules-to-cache: dbatools.library:${{ steps.get-version.outputs.version }} | |
- name: Install dbatools.library (preview versions) | |
if: steps.get-version.outputs.is_preview == 'True' | |
shell: pwsh | |
run: | | |
Write-Output "Preview version detected, bypassing PSModuleCache and using install script" | |
./.github/scripts/install-dbatools-library.ps1 | |
- name: Perform the import | |
shell: pwsh | |
run: | | |
Import-Module ./dbatools.psd1 -ErrorAction Stop | |
(Get-DbaManagementObject).LoadTemplate -ne $null |