-
-
Notifications
You must be signed in to change notification settings - Fork 863
71 lines (64 loc) · 2.2 KB
/
xplat-import.yml
File metadata and controls
71 lines (64 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Cross Platform Import
on:
push:
branches-ignore:
- master
tags-ignore:
- '**'
paths-ignore:
- '**/*.md'
- '**/*.json'
- 'docs/**'
- '.github/FUNDING.yml'
- '.github/ISSUE_TEMPLATE/**'
- '.github/PULL_REQUEST_TEMPLATE.md'
- '.aider/**'
- '.devcontainer/**'
- '.vscode/**'
- 'bin/**'
- 'en-us/**'
- '!.github/dbatools-library-version.json'
- '!bin/dbatools-buildref-index.json'
- '!bin/dbatools-sqlinstallationcomponents.json'
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