Update Windows 11 Start menu layout #253
This file contains hidden or 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
| name: "Validate project" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'src/**' | |
| - 'tests/*.ps1' | |
| - '!src/VERSION.txt' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write # Required for committing version changes and pushing to repository | |
| security-events: write # Required for uploading SARIF results to GitHub Security | |
| checks: write # Required for publishing test results | |
| pull-requests: write # Required for commenting on PRs with test results (if applicable) | |
| jobs: | |
| validate: | |
| name: "Validate project code" | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| ref: main | |
| - name: Run PSScriptAnalyzer | |
| uses: microsoft/psscriptanalyzer-action@6b2948b1944407914a58661c49941824d149734f | |
| with: | |
| path: ./src | |
| recurse: true | |
| # output: results.sarif | |
| # # Upload the SARIF file generated in the previous step | |
| # - name: Upload SARIF results file | |
| # uses: github/codeql-action/upload-sarif@v4 | |
| # with: | |
| # sarif_file: results.sarif | |
| - name: Install Pester | |
| shell: powershell | |
| working-directory: "${{ github.workspace }}" | |
| run: | | |
| Install-Module -Name "Pester" -SkipPublisherCheck -Force | |
| # Run Pester tests | |
| - name: Test with Pester | |
| shell: powershell | |
| working-directory: "${{ github.workspace }}" | |
| run: | | |
| Import-Module -Name "Pester" -Force -ErrorAction "Stop" | |
| $Config = New-PesterConfiguration | |
| $Config.Run.Path = "$env:GITHUB_WORKSPACE\tests" | |
| $Config.Run.PassThru = $true | |
| $Config.CodeCoverage.Enabled = $true | |
| $Config.CodeCoverage.CoveragePercentTarget = 50 | |
| $Files = Get-ChildItem -Path "$env:GITHUB_WORKSPACE\src" -Recurse -File -Include *.ps1 -Exclude "Start-DefaultsViewer.ps1" | |
| $Config.CodeCoverage.Path = $Files.FullName | |
| $Config.CodeCoverage.OutputFormat = "JaCoCo" | |
| $Config.CodeCoverage.OutputPath = "$env:GITHUB_WORKSPACE\CodeCoverage.xml" | |
| $Config.TestResult.Enabled = $true | |
| $Config.Output.Verbosity = "Detailed" | |
| $Config.TestResult.OutputFormat = "NUnitXml" | |
| $Config.TestResult.OutputPath = "$env:GITHUB_WORKSPACE\tests\TestResults.xml" | |
| Invoke-Pester -Configuration $Config | |
| # Upload test results | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: "${{ github.workspace }}\\tests\\TestResults.xml" | |
| # Publish test results | |
| - name: Publish test results | |
| uses: EnricoMi/publish-unit-test-result-action/windows@v2 | |
| if: always() | |
| with: | |
| files: "${{ github.workspace }}\\tests\\TestResults.xml" | |
| - name: Get version | |
| id: get-version | |
| shell: powershell | |
| working-directory: "${{ github.workspace }}" | |
| run: | | |
| echo "version=$(Get-Date -Format "yyMM.dd.$($env:GITHUB_RUN_NUMBER)")" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append | |
| # Update version number in VERSION.txt | |
| - name: Update version number | |
| shell: powershell | |
| working-directory: "${{ github.workspace }}" | |
| run: | | |
| "${{ steps.get-version.outputs.version }}" | ` | |
| Out-File -FilePath "${{ github.workspace }}\src\VERSION.txt" -Encoding "ascii" -Force -NoNewline | |
| # Import GPG key | |
| - name: Import GPG key | |
| id: import_gpg | |
| uses: crazy-max/ghaction-import-gpg@v7 | |
| with: | |
| gpg_private_key: ${{ secrets.GPGKEY }} | |
| passphrase: ${{ secrets.GPGPASSPHRASE }} | |
| git_user_signingkey: true | |
| git_commit_gpgsign: true | |
| git_config_global: true | |
| git_tag_gpgsign: true | |
| git_push_gpgsign: false | |
| git_committer_name: ${{ secrets.COMMIT_NAME }} | |
| git_committer_email: ${{ secrets.COMMIT_EMAIL }} | |
| - name: Commit changes | |
| id: commit | |
| uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| commit_message: "${{ steps.get-version.outputs.version }}" | |
| commit_user_name: ${{ secrets.COMMIT_NAME }} | |
| commit_user_email: ${{ secrets.COMMIT_EMAIL }} |