Skip to content

Commit

Permalink
module version fix??
Browse files Browse the repository at this point in the history
  • Loading branch information
hjorslev committed Mar 2, 2024
1 parent 75d8277 commit a078f83
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 44 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,60 +23,61 @@ env:

jobs:
build:
name: build
name: 👷 Build
runs-on: windows-latest
steps:
- name: Check out repository
- name: 🚚 Check out repository
uses: actions/checkout@v4

- name: Build module - Debug
- name: 🐛 Build module - Debug
shell: pwsh
run: ./build.ps1 -Configuration $env:BUILD_CONFIGURATION -Task Build
if: ${{ env.BUILD_CONFIGURATION == 'Debug' }}

- name: Build module - Publish
- name: 🚀 Build module - Publish
shell: pwsh
run: ./build.ps1 -Configuration $env:BUILD_CONFIGURATION -Task Build
if: ${{ env.BUILD_CONFIGURATION == 'Release' }}

- name: Capture PowerShell Module
- name: 📦 Capture PowerShell Module
uses: actions/upload-artifact@v4
with:
name: PSModule
path: output/*.nupkg

test:
name: test
name: 🧪 Test
needs:
- build
runs-on: ${{ matrix.info.os }}
strategy:
fail-fast: false
matrix:
info:
- name: Win2019_PS-5.1
- name: 🪟 Win2019_PS-5.1
psversion: '5.1'
os: windows-2019
- name: Win2019_PS-7
- name: 🪟 Win2019_PS-7
psversion: '7'
os: windows-2019
- name: Win2022_PS-5.1
- name: 🪟 Win2022_PS-5.1
psversion: '5.1'
os: windows-latest
- name: Win2022_PS-7
- name: 🪟 Win2022_PS-7
psversion: '7'
os: windows-latest

steps:
- uses: actions/checkout@v4
- name: 🚚 Checkout
uses: actions/checkout@v4

- name: Restore Built PowerShell Module
- name: Restore Built PowerShell Module
uses: actions/download-artifact@v4
with:
name: PSModule
path: output

- name: Install Built PowerShell Module
- name: 📦 Install Built PowerShell Module
shell: pwsh
run: |
$manifestItem = Get-Item ([IO.Path]::Combine('SteamPS', '*.psd1'))
Expand All @@ -92,52 +93,52 @@ jobs:
Expand-Archive -Path output/*.zip -DestinationPath $destPath -Force -ErrorAction Stop
- name: Run Tests - Windows PowerShell
- name: 🧪 Run Tests - Windows PowerShell
if: ${{ matrix.info.psversion == '5.1' }}
shell: powershell
run: ./build.ps1 -Configuration $env:BUILD_CONFIGURATION -Task Test

- name: Run Tests - PowerShell
- name: 🧪 Run Tests - PowerShell
if: ${{ matrix.info.psversion != '5.1' }}
shell: pwsh
run: ./build.ps1 -Configuration $env:BUILD_CONFIGURATION -Task Test

- name: Upload Test Results
- name: ⬆️ Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Unit Test Results (${{ matrix.info.name }})
path: ./output/TestResults/Pester.xml

- name: Upload Coverage Results
- name: ⬆️ Upload Coverage Results
if: always() && !startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: Coverage Results (${{ matrix.info.name }})
path: ./output/TestResults/Coverage.xml

- name: Upload Coverage to codecov
- name: ⬆️ Upload Coverage to codecov
if: always() && !startsWith(github.ref, 'refs/tags/v')
uses: codecov/codecov-action@v4
with:
files: ./output/TestResults/Coverage.json
flags: ${{ matrix.info.name }}

publish:
name: publish
name: 🚀 Deploy
if: startsWith(github.ref, 'refs/tags/v')
needs:
- build
- test
runs-on: windows-latest
steps:
- name: Restore Built PowerShell Module
- name: Restore Built PowerShell Module
uses: actions/download-artifact@v4
with:
name: PSModule
path: ./

- name: Publish to Gallery
- name: 🚀 Publish to Gallery
if: github.event_name == 'release'
shell: pwsh
run: >-
Expand All @@ -146,4 +147,4 @@ jobs:
--source 'https://www.powershellgallery.com/api/v2/package'
--no-symbols
env:
PSGALLERY_TOKEN: ${{ secrets.PSGALLERY_TOKEN }}
PSGALLERY_TOKEN: ${{ secrets.PS_GALLERY_KEY }}
2 changes: 1 addition & 1 deletion SteamPS/SteamPS.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ ModuleName = 'PSFramework'; GUID = '8028b914-132b-431f-baa9-94a6952f21ff'; ModuleVersion = '1.10.318' })
# RequiredModules = @(@{ ModuleName = 'PSFramework'; GUID = '8028b914-132b-431f-baa9-94a6952f21ff'; ModuleVersion = '1.10.318' })

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
Expand Down
19 changes: 0 additions & 19 deletions Tests/PSScriptAnalyzer.Tests.ps1

This file was deleted.

2 changes: 0 additions & 2 deletions Tests/SteamPS.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Describe 'SteamCMD cmdlets' {
Test-Path -Path "$TestDrive\Test\SteamCMD\steamcmd.exe" | Should -BeTrue
}

<#
Context 'Update-SteamApp' {
It 'Installs Ground Branch Dedicated Server using AppID' {
Update-SteamApp -AppID 476400 -Path "$TestDrive\GB-AppID" -Force
Expand All @@ -34,7 +33,6 @@ Describe 'SteamCMD cmdlets' {
Test-Path -Path "$TestDrive\GB-TestingBranch\GroundBranchServer.exe" | Should -BeTrue
}
}
#>

AfterAll {
# Wait for the process steamerrorreporter to be closed - else test folder wont be deleted.
Expand Down

0 comments on commit a078f83

Please sign in to comment.