Skip to content

Commit

Permalink
Dynamically Determine which Modules for psmodulecache (#4)
Browse files Browse the repository at this point in the history
This determines the modules in the requirements file and caches those. One less thing to manually bump.
  • Loading branch information
HeyItsGilbert authored Oct 2, 2023
1 parent cca0214 commit 8ab54ba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: CI
on: [push, pull_request]
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
checks: write
pull-requests: write
jobs:
test:
name: Run Tests
Expand All @@ -10,11 +18,18 @@ jobs:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- name: GetDependancies
id: getdepends
shell: pwsh
run: |
$d = (Import-PowerShellDataFile .\requirements.psd1).GetEnumerator() | Where-Object { $_.Name -ne 'PSDependOptions'}
$output = ($d | ForEach-Object { "{0}:{1}" -F $_.Name, $_.Value.Version}) -join ', '
Add-Content -Path $env:GITHUB_OUTPUT -Value "modules-to-cache=$output"
- name: Install and cache PowerShell modules
id: psmodulecache
uses: potatoqualitee/psmodulecache@v4.5
with:
modules-to-cache: Pester:5.3.3, psake:4.9.0, BuildHelpers:2.0.16, PowerShellBuild:0.6.1, PSScriptAnalyzer:1.19.1
modules-to-cache: ${{ steps.getdepends.outputs.modules-to-cache}}
shell: pwsh
- name: Test
shell: pwsh
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MazeRats

A MazeRats PC and NPC generator in powershell!
A MazeRats PC and NPC generator in PowerShell!

[![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/MazeRats)
![PowerShell Gallery Version](https://img.shields.io/powershellgallery/v/MazeRats)
Expand Down
2 changes: 1 addition & 1 deletion requirements.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
Version = '1.19.1'
}
'RPGDice' = @{
Version = 'latest'
Version = '0.1.5'
}
}

0 comments on commit 8ab54ba

Please sign in to comment.