Add Governance Assignment cmdlets (#21) #104
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- CHANGELOG.md | |
- containers/** | |
- .github/** | |
tags: | |
- '**' | |
- '!*preview*' | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- CHANGELOG.md | |
- containers/** | |
- .github/** | |
env: | |
buildFolderName: output | |
buildArtifactName: output | |
testResultFolderName: testResults | |
permissions: write-all | |
jobs: | |
Build_Stage_Package_Module: | |
name: Package Module | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: 5.x | |
- name: Evaluate Next Version | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
configFilePath: GitVersion.yml | |
- name: Build & Package Module | |
shell: pwsh | |
run: ./build.ps1 -ResolveDependency -tasks pack -Verbose | |
env: | |
ModuleVersion: ${{ env.gitVersion.NuGetVersionV2 }} | |
- name: Publish Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.buildArtifactName }} | |
path: ${{ env.buildFolderName }}/ | |
Test_Stage_test_linux: | |
name: Linux | |
runs-on: ubuntu-latest | |
needs: Build_Stage_Package_Module | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.buildArtifactName }} | |
path: ${{ env.buildFolderName }} | |
- name: Run Tests | |
shell: pwsh | |
run: ./build.ps1 -tasks test | |
- name: Publish Test Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ${{ env.buildFolderName }}/${{ env.testResultFolderName }}/ | |
name: CodeCoverageLinux | |
if: success() || failure() | |
Test_Stage_test_windows_core: | |
name: Windows (PS Core) | |
runs-on: windows-2022 | |
needs: Build_Stage_Package_Module | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.buildArtifactName }} | |
path: ${{ env.buildFolderName }} | |
- name: Run Tests | |
shell: pwsh | |
run: ./build.ps1 -tasks test | |
- name: Publish Test Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ${{ env.buildFolderName }}/${{ env.testResultFolderName }}/ | |
name: CodeCoverageWinPS7 | |
if: success() || failure() | |
Test_Stage_test_macos: | |
name: macOS | |
runs-on: macos-latest | |
needs: Build_Stage_Package_Module | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.buildArtifactName }} | |
path: ${{ env.buildFolderName }} | |
- name: Run Tests | |
shell: pwsh | |
run: ./build.ps1 -tasks test | |
- name: Publish Test Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ${{ env.buildFolderName }}/${{ env.testResultFolderName }}/ | |
name: CodeCoverageMacOS | |
if: success() || failure() | |
Publish_Code_Coverage: | |
name: Publish Code Coverage | |
if: success() || failure() | |
runs-on: ubuntu-latest | |
needs: | |
- Build_Stage_Package_Module | |
- Test_Stage_test_linux | |
- Test_Stage_test_windows_core | |
- Test_Stage_test_macos | |
steps: | |
# - name: Checkout Code | |
# uses: actions/checkout@v4 | |
# with: | |
# fetch-depth: 0 | |
# - name: Download Test Artifacts | |
# uses: actions/download-artifact@v4 | |
# with: | |
# path: ${{ env.buildFolderName }}/${{ env.testResultFolderName }}/ | |
- name: Download Test Artifact macOS | |
uses: actions/download-artifact@v4 | |
with: | |
name: CodeCoverageMacOS | |
path: ${{ env.buildFolderName }}/${{ env.testResultFolderName }}/CodeCoverageMacOS/ | |
- name: Download Test Artifact Linux | |
uses: actions/download-artifact@v4 | |
with: | |
name: CodeCoverageLinux | |
path: ${{ env.buildFolderName }}/${{ env.testResultFolderName }}/CodeCoverageLinux/ | |
- name: Download Test Artifact Windows (PS7) | |
uses: actions/download-artifact@v4 | |
with: | |
name: CodeCoverageWinPS7 | |
path: ${{ env.buildFolderName }}/${{ env.testResultFolderName }}/CodeCoverageWinPS7/ | |
- name: Publish MacOs Test Results | |
id: macos-test-results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
nunit_files: ${{ env.buildFolderName }}/${{ env.testResultFolderName }}/CodeCoverageMacOS/NUnit*.xml | |
check_name: MacOs Test Results | |
- name: Publish Linux Test Results | |
id: linux-test-results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
nunit_files: ${{ env.buildFolderName }}/${{ env.testResultFolderName }}/CodeCoverageLinux/NUnit*.xml | |
check_name: Linux Test Results | |
- name: Publish WinPS71 Test Results | |
id: winps71-test-results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
nunit_files: ${{ env.buildFolderName }}/${{ env.testResultFolderName }}/CodeCoverageWinPS7/NUnit*.xml | |
check_name: WinPS71 Test Results | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: CyberShell-App/CyberShell | |
Deploy_Stage_Deploy_Module: | |
name: Deploy Module | |
runs-on: ubuntu-latest | |
needs: | |
- Build_Stage_Package_Module | |
- Test_Stage_test_linux | |
- Test_Stage_test_windows_core | |
- Test_Stage_test_macos | |
- Publish_Code_Coverage | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.buildArtifactName }} | |
path: ${{ env.buildFolderName }} | |
- name: Publish Release | |
shell: pwsh | |
run: ./build.ps1 -tasks publish | |
env: | |
GitHubToken: ${{ secrets.GitHubToken }} | |
GalleryApiToken: ${{ secrets.GalleryApiToken }} | |
- name: Send Changelog PR | |
shell: pwsh | |
run: ./build.ps1 -tasks Create_ChangeLog_GitHub_PR | |
env: | |
GitHubToken: ${{ secrets.GitHubToken }} |