diff --git a/.github/workflows/BuildModule.yml b/.github/workflows/BuildModule.yml deleted file mode 100644 index 274a677e..00000000 --- a/.github/workflows/BuildModule.yml +++ /dev/null @@ -1,56 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Build & Publish PowerShell Module - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the "master" branch - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: windows-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - - #- name: Setup PowerShell module cache - # id: cacher - # uses: actions/cache@v3 - # with: - # path: "~/.local/share/powershell/Modules" - # key: ${{ runner.os }}-MyModules - - - name: Install required PowerShell modules - # if: steps.cacher.outputs.cache-hit != 'true' - shell: pwsh - run: | - Set-PSRepository PSGallery -InstallationPolicy Trusted - Install-Module PSPublishModule -ErrorAction Stop -Force -Verbose - - - name: Test with Pester - shell: pwsh - run: .\PSWriteHTML.Tests.ps1 - #Invoke-Pester -Script .\Tests -Passthru | Export-CliXml -Path PesterTestResultsBeforeBuild.xml - - - name: Upload test results - uses: actions/upload-artifact@v3 - with: - name: Pester Test Results Before Build - path: PesterTestResultsBeforeBuild.xml - - - name: Build Module - shell: pwsh - run: .\Build\BuildModule.ps1 - if: ${{ always() }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..aaa2ecb7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,176 @@ +name: Test PowerShell + +on: + workflow_dispatch: + push: + branches: + - master + paths-ignore: + - '*.md' + - 'Docs/**' + - 'Examples/**' + - '.gitignore' + pull_request: + branches: + - master + +env: + BUILD_CONFIGURATION: 'Debug' + +jobs: + refresh-psd1: + name: 'Refresh PSD1' + runs-on: windows-latest + timeout-minutes: 20 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref }} + + - name: Setup PowerShell modules + run: | + Install-Module PSPublishModule -Force -Scope CurrentUser -AllowClobber + Install-Module PSWriteColor -Force -Scope CurrentUser -AllowClobber + Install-Module PSSharedGoods -Force -Scope CurrentUser -AllowClobber + shell: pwsh + + - name: Refresh module manifest + env: + RefreshPSD1Only: 'true' + run: | + ./Build/Build-Module.ps1 + shell: pwsh + + - name: Commit refreshed PSD1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HEAD_BRANCH: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }} + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add PSWriteHTML.psd1 + git commit -m "chore: regenerate psd1" || echo "No changes to commit" + git push origin HEAD:$Env:HEAD_BRANCH + shell: pwsh + + - name: Upload refreshed manifest + uses: actions/upload-artifact@v4 + with: + name: psd1 + path: PSWriteHTML.psd1 + + test-windows-ps5: + needs: refresh-psd1 + name: 'Windows PowerShell 5.1' + runs-on: windows-latest + timeout-minutes: 20 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download manifest + uses: actions/download-artifact@v4 + with: + name: psd1 + path: . + + - name: Install PowerShell modules + run: | + Install-Module -Name Pester -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber + Install-Module -Name PSWriteColor -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber + Install-Module -Name PSSharedGoods -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber + shell: powershell + + - name: Run PowerShell tests + run: ./PSWriteHTML.Tests.ps1 + shell: powershell + + test-windows-ps7: + needs: refresh-psd1 + name: 'Windows PowerShell 7' + runs-on: windows-latest + timeout-minutes: 20 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download manifest + uses: actions/download-artifact@v4 + with: + name: psd1 + path: . + + - name: Install PowerShell modules + run: | + Install-Module -Name Pester -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber + Install-Module -Name PSWriteColor -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber + Install-Module -Name PSSharedGoods -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber + shell: pwsh + + - name: Run PowerShell tests + run: ./PSWriteHTML.Tests.ps1 + shell: pwsh + + test-ubuntu: + needs: refresh-psd1 + name: 'Ubuntu PowerShell 7' + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download manifest + uses: actions/download-artifact@v4 + with: + name: psd1 + path: . + + - name: Install PowerShell + run: | + curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - + curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list + sudo apt-get update + sudo apt-get install -y powershell + + - name: Install PowerShell modules + run: | + Install-Module -Name Pester -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber + Install-Module -Name PSWriteColor -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber + Install-Module -Name PSSharedGoods -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber + shell: pwsh + + - name: Run PowerShell tests + run: ./PSWriteHTML.Tests.ps1 + shell: pwsh + + test-macos: + needs: refresh-psd1 + name: 'macOS PowerShell 7' + runs-on: macos-latest + timeout-minutes: 20 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download manifest + uses: actions/download-artifact@v4 + with: + name: psd1 + path: . + + - name: Install PowerShell + run: brew install --cask powershell + + - name: Install PowerShell modules + run: | + Install-Module -Name Pester -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber + Install-Module -Name PSWriteColor -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber + Install-Module -Name PSSharedGoods -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber + shell: pwsh + + - name: Run PowerShell tests + run: ./PSWriteHTML.Tests.ps1 + shell: pwsh diff --git a/PSWriteHTML.AzurePipelines.yml b/PSWriteHTML.AzurePipelines.yml deleted file mode 100644 index 9bf51bbb..00000000 --- a/PSWriteHTML.AzurePipelines.yml +++ /dev/null @@ -1,39 +0,0 @@ -jobs: - - job: Build_PS_Win2016 - pool: - vmImage: windows-latest - steps: - - powershell: | - Install-Module -Name Pester -Repository PSGallery -Force -SkipPublisherCheck - .\PSWriteHTML.Tests.ps1 - displayName: "Run Pester Tests - PowerShell 5" - - pwsh: '.\PSWriteHTML.Tests.ps1' - displayName: "Run Pester Tests - PowerShell 7+" - - - job: Build_PSCore_Ubuntu1604 - pool: - vmImage: ubuntu-latest - steps: - - script: | - curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - - curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list - sudo apt-get update - sudo apt-get install -y powershell - displayName: "Install PowerShell Core" - - script: | - pwsh -c '.\PSWriteHTML.Tests.ps1' - displayName: "Run Pester Tests" - - - job: Build_PSCore_MacOS1013 - pool: - vmImage: macOS-latest - steps: - - script: | - brew update - brew tap caskroom/cask - brew install mono-libgdiplus - brew install --cask powershell - displayName: "Install PowerShell Core" - - script: | - pwsh -c '.\PSWriteHTML.Tests.ps1' - displayName: "Run Pester Tests" diff --git a/PSWriteHTML.psd1 b/PSWriteHTML.psd1 index fb5c69e5..bdaa2b88 100644 --- a/PSWriteHTML.psd1 +++ b/PSWriteHTML.psd1 @@ -8,7 +8,7 @@ Description = 'PSWriteHTML is PowerShell Module to generate beautiful HTML reports, pages, emails without any knowledge of HTML, CSS or JavaScript. To get started basics PowerShell knowledge is required.' FunctionsToExport = @('Add-HTML', 'Add-HTMLScript', 'Add-HTMLStyle', 'ConvertTo-CascadingStyleSheets', 'Email', 'EmailAttachment', 'EmailBCC', 'EmailBody', 'EmailCC', 'EmailFrom', 'EmailHeader', 'EmailLayout', 'EmailLayoutColumn', 'EmailLayoutRow', 'EmailListItem', 'EmailOptions', 'EmailReplyTo', 'EmailServer', 'EmailSubject', 'EmailTo', 'Enable-HTMLFeature', 'New-AccordionItem', 'New-CalendarEvent', 'New-CarouselSlide', 'New-ChartAxisX', 'New-ChartAxisY', 'New-ChartBar', 'New-ChartBarOptions', 'New-ChartDataLabel', 'New-ChartDesign', 'New-ChartDonut', 'New-ChartEvent', 'New-ChartGrid', 'New-ChartLegend', 'New-ChartLine', 'New-ChartMarker', 'New-ChartPie', 'New-ChartRadial', 'New-ChartRadialOptions', 'New-ChartSpark', 'New-ChartTheme', 'New-ChartTimeLine', 'New-ChartToolbar', 'New-ChartToolTip', 'New-DiagramEvent', 'New-DiagramLink', 'New-DiagramNode', 'New-DiagramOptionsInteraction', 'New-DiagramOptionsLayout', 'New-DiagramOptionsLinks', 'New-DiagramOptionsManipulation', 'New-DiagramOptionsNodes', 'New-DiagramOptionsPhysics', 'New-GageSector', 'New-HierarchicalTreeNode', 'New-HTML', 'New-HTMLAccordion', 'New-HTMLAnchor', 'New-HTMLCalendar', 'New-HTMLCarousel', 'New-HTMLCarouselStyle', 'New-HTMLChart', 'New-HTMLCodeBlock', 'New-HTMLContainer', 'New-HTMLDate', 'New-HTMLDiagram', 'New-HTMLFontIcon', 'New-HTMLFooter', 'New-HTMLFrame', 'New-HTMLGage', 'New-HTMLHeader', 'New-HTMLHeading', 'New-HTMLHierarchicalTree', 'New-HTMLHorizontalLine', 'New-HTMLImage', 'New-HTMLInfoCard', 'New-HTMLList', 'New-HTMLListItem', 'New-HTMLLogo', 'New-HTMLMain', 'New-HTMLMap', 'New-HTMLMarkdown', 'New-HTMLMermeidChart', 'New-HTMLNav', 'New-HTMLNavFloat', 'New-HTMLNavTop', 'New-HTMLOrgChart', 'New-HTMLPage', 'New-HTMLPanel', 'New-HTMLPanelStyle', 'New-HTMLQRCode', 'New-HTMLSection', 'New-HTMLSectionScrolling', 'New-HTMLSectionScrollingItem', 'New-HTMLSectionStyle', 'New-HTMLSpanStyle', 'New-HTMLStatus', 'New-HTMLStatusItem', 'New-HTMLSummary', 'New-HTMLSummaryItem', 'New-HTMLSummaryItemData', 'New-HTMLTab', 'New-HTMLTable', 'New-HTMLTableOption', 'New-HTMLTableStyle', 'New-HTMLTabPanel', 'New-HTMLTabPanelColor', 'New-HTMLTabStyle', 'New-HTMLTag', 'New-HTMLText', 'New-HTMLTextBox', 'New-HTMLTimeline', 'New-HTMLTimelineItem', 'New-HTMLToast', 'New-HTMLTree', 'New-HTMLTreeChildCounter', 'New-HTMLTreeNode', 'New-HTMLWinBox', 'New-HTMLWizard', 'New-HTMLWizardColor', 'New-HTMLWizardStep', 'New-MapArea', 'New-MapLegendOption', 'New-MapLegendSlice', 'New-MapPlot', 'New-NavFloatWidget', 'New-NavFloatWidgetItem', 'New-NavItem', 'New-NavLink', 'New-NavTopMenu', 'New-OrgChartNode', 'New-TableAlphabetSearch', 'New-TableButtonColumnVisibility', 'New-TableButtonCopy', 'New-TableButtonCSV', 'New-TableButtonExcel', 'New-TableButtonPageLength', 'New-TableButtonPDF', 'New-TableButtonPrint', 'New-TableButtonSearchBuilder', 'New-TableColumnOption', 'New-TableCondition', 'New-TableConditionGroup', 'New-TableContent', 'New-TableEvent', 'New-TableHeader', 'New-TableLanguage', 'New-TablePercentageBar', 'New-TablePercentageBarCondition', 'New-TableReplace', 'New-TableRowGrouping', 'Out-HtmlView', 'Save-HTML') GUID = 'a7bdf640-f5cb-4acf-9de0-365b322d245c' - ModuleVersion = '1.38.0' + ModuleVersion = '1.39.0' PowerShellVersion = '5.1' PrivateData = @{ PSData = @{ @@ -20,7 +20,7 @@ RequiredModules = @(@{ Guid = 'ee272aa8-baaa-4edf-9f45-b6d6f7d844fe' ModuleName = 'PSSharedGoods' - ModuleVersion = '0.0.309' + ModuleVersion = '0.0.310' }) RootModule = 'PSWriteHTML.psm1' } \ No newline at end of file