Switch to Powershell cmdlet and always install/upgrade to latest winget #6
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: 'Test Action' | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: 0 0 * * * | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test-job: | |
| name: Test Job (No GitHub token) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ 'windows-2022', 'windows-2025', 'windows-11-arm', 'windows-latest' ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Install winget | |
| id: install-winget | |
| uses: ./ | |
| - name: Check Version | |
| shell: bash | |
| run: | | |
| VERSION="${{ steps.install-winget.outputs.winget-version }}" | |
| if [ -z "$VERSION" ]; then | |
| exit 1 | |
| fi | |
| echo $VERSION | |
| - name: Install wingetcreate | |
| run: winget install wingetcreate --disable-interactivity --accept-source-agreements --accept-package-agreements | |
| test-job-with-token: | |
| name: Test with GitHub Token | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ 'windows-2025', 'windows-2025', 'windows-11-arm', 'windows-latest' ] | |
| repeat: [ 'a', 'b' ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Echo Runner OS version | |
| shell: powershell | |
| run: (Get-WmiObject Win32_OperatingSystem).Caption | |
| - name: Install winget | |
| id: install-winget | |
| uses: ./ | |
| with: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Check Version | |
| shell: bash | |
| run: | | |
| VERSION="${{ steps.install-winget.outputs.winget-version }}" | |
| if [ -z "$VERSION" ]; then | |
| exit 1 | |
| fi | |
| echo $VERSION | |
| - name: Install wingetcreate | |
| run: winget install wingetcreate --disable-interactivity --accept-source-agreements |