simplify drone setup
This commit is contained in:
parent
41ef877111
commit
10679ecd23
52
.drone.yml
52
.drone.yml
@ -11,18 +11,32 @@ steps:
|
||||
- name: Environments
|
||||
image: mcr.microsoft.com/powershell:latest
|
||||
commands:
|
||||
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1' -Verbose; Invoke-ShowEnv -Verbose}"
|
||||
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1' -Verbose; Invoke-InstallDependencies -Verbose}"
|
||||
- |
|
||||
pwsh -NonInteractive -c "& {
|
||||
Import-Module './tools/DroneIO.psm1' -Verbose;
|
||||
Invoke-ShowEnv -Verbose
|
||||
}"
|
||||
|
||||
- name: LintTests
|
||||
image: mcr.microsoft.com/powershell:latest
|
||||
commands:
|
||||
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1'; Invoke-InstallDependencies}"
|
||||
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1'; Invoke-Linter}"
|
||||
- |
|
||||
pwsh -NonInteractive -c "& {
|
||||
Import-Module './tools/DroneIO.psm1';
|
||||
Invoke-InstallDependencies;
|
||||
Invoke-Linter
|
||||
}"
|
||||
|
||||
- name: UnitTests
|
||||
image: mcr.microsoft.com/powershell:latest
|
||||
commands:
|
||||
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1'; Invoke-InstallDependencies}"
|
||||
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1'; Invoke-UnitTests}"
|
||||
- |
|
||||
pwsh -NonInteractive -c "& {
|
||||
Import-Module './tools/DroneIO.psm1';
|
||||
Invoke-InstallDependencies;
|
||||
Invoke-UnitTest
|
||||
}"
|
||||
|
||||
- name: coverage
|
||||
image: plugins/codecov
|
||||
settings:
|
||||
@ -30,29 +44,3 @@ steps:
|
||||
from_secret: CodeCovToken
|
||||
files:
|
||||
- coverage.xml
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: WINDOWS_PWSH7_Build
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: Environments
|
||||
image: mcr.microsoft.com/powershell:lts-windowsservercore-ltsc2022
|
||||
commands:
|
||||
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1' -Verbose; Invoke-ShowEnv -Verbose}"
|
||||
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1' -Verbose; Invoke-InstallDependencies -Verbose}"
|
||||
- name: LintTests
|
||||
image: mcr.microsoft.com/powershell:lts-windowsservercore-ltsc2022
|
||||
commands:
|
||||
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1'; Invoke-InstallDependencies}"
|
||||
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1'; Invoke-Linter}"
|
||||
- name: UnitTests
|
||||
image: mcr.microsoft.com/powershell:lts-windowsservercore-ltsc2022
|
||||
commands:
|
||||
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1'; Invoke-InstallDependencies}"
|
||||
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1'; Invoke-UnitTests}"
|
||||
|
@ -30,11 +30,41 @@ function Invoke-InstallDependencies {
|
||||
param ()
|
||||
|
||||
process {
|
||||
$ErrorActionPreference = 'Stop'
|
||||
try {
|
||||
Install-Module -Name 'PSScriptAnalyzer' -Scope CurrentUser -RequiredVersion '1.19.1' -Force -SkipPublisherCheck -AllowClobber -Verbose:$VerbosePreference -ErrorAction 'Stop'
|
||||
Install-Module -Name 'Pester' -Scope CurrentUser -RequiredVersion '4.10.1' -Force -SkipPublisherCheck -AllowClobber -Verbose:$VerbosePreference -ErrorAction 'Stop'
|
||||
Install-Module -Name 'posh-git' -Scope CurrentUser -RequiredVersion '0.7.3' -Force -SkipPublisherCheck -AllowClobber -Verbose:$VerbosePreference -ErrorAction 'Stop'
|
||||
Install-Module -Name 'PSCoverage' -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber -RequiredVersion '1.2.108' -Verbose:$VerbosePreference -ErrorAction 'Stop'
|
||||
$ParamsPSScript = @{
|
||||
Name = 'PSScriptAnalyzer'
|
||||
Scope = 'CurrentUser'
|
||||
RequiredVersion = '1.20.0'
|
||||
Force = $true
|
||||
SkipPublisherCheck = $true
|
||||
AllowClobber = $true
|
||||
Verbose = $VerbosePreference
|
||||
}
|
||||
Install-Module @ParamsPSScript
|
||||
|
||||
$ParamsPester = @{
|
||||
Name = 'Pester'
|
||||
Scope = 'CurrentUser'
|
||||
RequiredVersion = '5.3.3'
|
||||
Force = $true
|
||||
SkipPublisherCheck = $true
|
||||
AllowClobber = $true
|
||||
Verbose = $VerbosePreference
|
||||
}
|
||||
Install-Module @ParamsPester
|
||||
|
||||
$ParamsPosh = @{
|
||||
Name = 'posh-git'
|
||||
Scope = 'CurrentUser'
|
||||
RequiredVersion = '1.1.0'
|
||||
Force = $true
|
||||
SkipPublisherCheck = $true
|
||||
AllowClobber = $true
|
||||
Verbose = $VerbosePreference
|
||||
#ErrorAction = 'Stop'
|
||||
}
|
||||
Install-Module @ParamsPosh
|
||||
}
|
||||
catch {
|
||||
$ExceParams = @{
|
||||
|
Loading…
Reference in New Issue
Block a user