Add verification for the package input parameter
#29
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: verify | |
| on: | |
| workflow_dispatch: | |
| push: | |
| pull_request_target: | |
| permissions: | |
| contents: read | |
| jobs: | |
| verify-macos: | |
| name: Verify on macOS runner | |
| runs-on: macos-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v6 | |
| - name: run setup-powerpoint | |
| uses: ./ | |
| - name: verify installation | |
| run: | | |
| if [ ! -d "/Applications/Microsoft PowerPoint.app" ]; then | |
| echo "Microsoft PowerPoint is not installed" | |
| exit 1 | |
| fi | |
| echo "Microsoft PowerPoint is installed" | |
| - name: troubleshoot desktop | |
| run: | | |
| screencapture ./desktop.png | |
| - name: upload desktop screenshot | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: desktop-screenshot | |
| path: desktop.png | |
| verify-macos-custom-package: | |
| name: Verify on macOS runner (custom installer package) | |
| runs-on: macos-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v6 | |
| - name: run setup-powerpoint | |
| uses: ./ | |
| with: | |
| package: Microsoft_PowerPoint_16.102.25101829_Updater.pkg | |
| - name: verify custom release | |
| run: | | |
| if [ ! -d "/Applications/Microsoft PowerPoint.app" ]; then | |
| echo "Microsoft PowerPoint is not installed" | |
| exit 1 | |
| fi | |
| version=$(defaults read "/Applications/Microsoft PowerPoint.app/Contents/Info.plist" CFBundleShortVersionString || true) | |
| if [ "$version" != "16.102.1" ]; then | |
| echo "Unexpected PowerPoint version: '$version' (expected 16.102.1)" | |
| exit 1 | |
| fi | |
| echo "Microsoft PowerPoint version is $version" | |
| verify-ubuntu: | |
| name: Verify on Ubuntu runner | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: run setup-powerpoint (expected failure) | |
| id: setup | |
| continue-on-error: true | |
| uses: ./ | |
| - name: assert action failed | |
| if: ${{ !cancelled() }} | |
| run: | | |
| if [ "${{ steps.setup.outcome }}" != "failure" ]; then | |
| echo "Action unexpectedly succeeded on a Ubuntu runner" | |
| exit 1 | |
| fi | |
| echo "Action correctly failed on Ubuntu runner" | |
| verify-windows: | |
| name: Verify on Windows runner | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: run setup-powerpoint (expected failure) | |
| id: setup | |
| continue-on-error: true | |
| uses: ./ | |
| - name: assert action failed | |
| if: ${{ !cancelled() }} | |
| shell: pwsh | |
| run: | | |
| if ("${{ steps.setup.outcome }}" -ne "failure") { | |
| Write-Error "Action unexpectedly succeeded on a Windows runner" | |
| exit 1 | |
| } | |
| Write-Host "Action correctly failed on Windows runner" |