Skip to content

Commit 24c651c

Browse files
Add initial test configurations, modules, and functions (#13)
## Description This pull request updates the GitHub Actions workflows, the addition of new helper scripts, and changes to the action configuration. ### Updates to GitHub Actions workflows * [`.github/workflows/Action-Test.yml`](diffhunk://#diff-a12ae5c885b0673c0ff6f70c2670886907590d624626e07da4c52e01aeaf56a4R11-R45): Added environment variables, updated permissions, and modified job steps to include initializing the environment and uploading module artifacts. * [`.github/workflows/Auto-Configure.yml`](diffhunk://#diff-562d3c45cd0b18dab88b67d776b74c8115b8775d4ffffacf2b064a23469f5443L1-L34): Removed the Auto-Configure workflow. * [`.github/workflows/Auto-Document.yml`](diffhunk://#diff-d4d2f065436a753ebb20ab1c11aaf55c1ae9fbad1f8c4a76526f16a451759633L1-L31): Removed the Auto-Document workflow. * [`.github/workflows/Linter.yml`](diffhunk://#diff-482e65806ed9e4a7320f14964764086b91fed4a28d12e4efde1776472e147e79R30-R33): Disabled validation for markdown, JSON, YAML, and JSCPD in the linter configuration. ### New helper functions: * [`scripts/helpers/Build-PSModuleDocumentation.ps1`](diffhunk://#diff-95b236851bd9052577a2cdf569f08e195e7d6cc424f6cb6d074ccc10b2cb7241R1-R126): Added a new function to build module documentation, including generating markdown help and fixing markdown code blocks. * [`scripts/helpers/Import-PSModule.ps1`](diffhunk://#diff-e4bfa9c4a169541b0894ed0c4f60df9fcde101f9bd11ea736e8c8173b15de476R1-R50): Added a new function to import a PowerShell module from a specified path. * [`scripts/helpers/Resolve-PSModuleDependency.ps1`](diffhunk://#diff-48557b471e7d62a89be3627235334ab8a39eb6119174abb61714b92d844508e2R1-R64): Added a new function to resolve module dependencies based on the manifest file. ### Updates to action configuration: * [`action.yml`](diffhunk://#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6L1-R79): Updated the action name, description, and inputs to better reflect the new functionality. Added steps to download module artifacts, run the documentation build script, and upload documentation artifacts. ### Documentation and configuration updates: * [`tests/outputs/modules/PSModuleTest/PSModuleTest.psd1`](diffhunk://#diff-39b31e19473e744165c2dd765b29282450842905b1e7c37f54f356a7d87535a6R1-R75): Added a new module manifest file for `PSModuleTest` with detailed module configuration. * [`.gitattributes`](diffhunk://#diff-618cd5b83d62060ba3d027e314a21ceaf75d36067ff820db126642944145393eR1-R15): Added configuration to handle different file types and ensure proper line endings. These changes collectively improve the automation, documentation, and configuration management of the project. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 21109a3 commit 24c651c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1712
-238
lines changed

.gitattributes

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Needed for publishing of examples, build worker defaults to core.autocrlf=input.
2+
* text eol=autocrlf
3+
4+
*.mof text eol=crlf
5+
*.sh text eol=lf
6+
*.svg eol=lf
7+
8+
# Ensure any exe files are treated as binary
9+
*.exe binary
10+
*.jpg binary
11+
*.xl* binary
12+
*.pfx binary
13+
*.png binary
14+
*.dll binary
15+
*.so binary

.github/workflows/Action-Test.yml

Lines changed: 45 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,45 @@
1-
name: Action-Test
2-
3-
run-name: "Action-Test - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4-
5-
on:
6-
workflow_dispatch:
7-
pull_request:
8-
schedule:
9-
- cron: '0 0 * * *'
10-
11-
concurrency:
12-
group: ${{ github.workflow }}-${{ github.ref }}
13-
cancel-in-progress: true
14-
15-
permissions:
16-
contents: read
17-
pull-requests: read
18-
19-
jobs:
20-
ActionTestBasic:
21-
name: Action-Test - [Basic]
22-
runs-on: ubuntu-latest
23-
steps:
24-
# Need to check out as part of the test, as its a local action
25-
- name: Checkout repo
26-
uses: actions/checkout@v4
27-
28-
- name: Action-Test
29-
uses: ./
30-
with:
31-
working-directory: ./tests
32-
subject: PSModule
1+
name: Action-Test
2+
3+
run-name: "Action-Test - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4+
5+
on:
6+
workflow_dispatch:
7+
pull_request:
8+
schedule:
9+
- cron: '0 0 * * *'
10+
11+
env:
12+
GH_TOKEN: ${{ github.token }}
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
permissions: {}
19+
20+
jobs:
21+
ActionTestDefault:
22+
name: Action-Test - [Default]
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout repo
26+
uses: actions/checkout@v4
27+
28+
- name: Initialize environment
29+
uses: PSModule/Initialize-PSModule@main
30+
31+
- name: Upload module artifact
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: module
35+
path: tests/outputs/modules
36+
if-no-files-found: error
37+
retention-days: 1
38+
39+
- name: Action-Test
40+
uses: ./
41+
with:
42+
Name: PSModuleTest
43+
Path: tests/src
44+
ModulesOutputPath: tests/outputs/modules
45+
DocsOutputPath: tests/outputs/docs

.github/workflows/Auto-Configure.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/Auto-Document.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/Auto-Release.yml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
name: Auto-Release
2-
3-
run-name: "Auto-Release - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4-
5-
on:
6-
pull_request_target:
7-
branches:
8-
- main
9-
types:
10-
- closed
11-
- opened
12-
- reopened
13-
- synchronize
14-
- labeled
15-
16-
concurrency:
17-
group: ${{ github.workflow }}-${{ github.ref }}
18-
cancel-in-progress: true
19-
20-
permissions:
21-
contents: write # Required to create releases
22-
pull-requests: write # Required to create comments on the PRs
23-
24-
jobs:
25-
Auto-Release:
26-
runs-on: ubuntu-latest
27-
steps:
28-
- name: Checkout Code
29-
uses: actions/checkout@v4
30-
31-
- name: Auto-Release
32-
uses: PSModule/Auto-Release@v1
33-
env:
34-
GITHUB_TOKEN: ${{ github.token }}
1+
name: Auto-Release
2+
3+
run-name: "Auto-Release - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4+
5+
on:
6+
pull_request_target:
7+
branches:
8+
- main
9+
types:
10+
- closed
11+
- opened
12+
- reopened
13+
- synchronize
14+
- labeled
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: write # Required to create releases
22+
pull-requests: write # Required to create comments on the PRs
23+
24+
jobs:
25+
Auto-Release:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout Code
29+
uses: actions/checkout@v4
30+
31+
- name: Auto-Release
32+
uses: PSModule/Auto-Release@v1
33+
env:
34+
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/Linter.yml

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
1-
name: Linter
2-
3-
run-name: "Linter - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4-
5-
on: [pull_request]
6-
7-
concurrency:
8-
group: ${{ github.workflow }}-${{ github.ref }}
9-
cancel-in-progress: true
10-
11-
permissions:
12-
contents: read
13-
packages: read
14-
statuses: write
15-
16-
jobs:
17-
Lint:
18-
name: Lint code base
19-
runs-on: ubuntu-latest
20-
steps:
21-
- name: Checkout repo
22-
uses: actions/checkout@v4
23-
with:
24-
fetch-depth: 0
25-
26-
- name: Lint code base
27-
uses: super-linter/super-linter/slim@latest
28-
env:
29-
GITHUB_TOKEN: ${{ github.token }}
1+
name: Linter
2+
3+
run-name: "Linter - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4+
5+
on: [pull_request]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
packages: read
14+
statuses: write
15+
16+
jobs:
17+
Lint:
18+
name: Lint code base
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repo
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Lint code base
27+
uses: super-linter/super-linter/slim@latest
28+
env:
29+
GITHUB_TOKEN: ${{ github.token }}
30+
VALIDATE_MARKDOWN_PRETTIER: false
31+
VALIDATE_JSON_PRETTIER: false
32+
VALIDATE_YAML_PRETTIER: false
33+
VALIDATE_JSCPD: false

.gitignore

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
## Ignore Visual Studio Code temporary files, build results, and
2-
## files generated by popular Visual Studio Code add-ons.
3-
##
4-
## Get latest from https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore
5-
.vscode/*
6-
!.vscode/settings.json
7-
!.vscode/extensions.json
8-
*.code-workspace
9-
10-
# Local History for Visual Studio Code
11-
.history/
1+
## Ignore Visual Studio Code temporary files, build results, and
2+
## files generated by popular Visual Studio Code add-ons.
3+
##
4+
## Get latest from https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore
5+
.vscode/*
6+
!.vscode/settings.json
7+
!.vscode/extensions.json
8+
*.code-workspace
9+
10+
# Local History for Visual Studio Code
11+
.history/

LICENSE

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
MIT License
2-
3-
Copyright (c) 2025 PSModule
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
1+
MIT License
2+
3+
Copyright (c) 2025 PSModule
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)