fix: make test-action work on windows #12
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 | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| test-download-script: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run tests | |
| run: python3 test.py | |
| test-action: | |
| timeout-minutes: 25 | |
| strategy: | |
| matrix: | |
| include: | |
| - variant: Linux-X64 | |
| runs-on: ubuntu-latest | |
| - variant: Linux-ARM64 | |
| runs-on: ubuntu-24.04-arm | |
| - variant: Windows-X64 | |
| runs-on: windows-latest | |
| - variant: Windows-ARM64 | |
| runs-on: windows-11-arm | |
| - variant: macOS-X64 | |
| runs-on: macos-13 | |
| - variant: macOS-ARM64 | |
| runs-on: macos-latest | |
| runs-on: ${{ matrix.runs-on }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Schedule wush kill on non-Windows runners | |
| if: ${{ runner.os != 'Windows' }} | |
| shell: bash | |
| run: | | |
| nohup bash -c 'sleep 15 && pgrep -f wush && echo "wush is running" > wush.log && pkill -INT -f wush' >pkill.log 2>&1 & | |
| - name: Schedule wush kill on Windows runners | |
| if: ${{ runner.os == 'Windows' }} | |
| shell: pwsh | |
| run: | | |
| Start-Job -ScriptBlock { | |
| Start-Sleep 15 | |
| $processes = Get-Process -Name "*wush*" -ErrorAction SilentlyContinue | |
| if ($processes) { | |
| "wush is running" | Out-File wush.log | |
| $processes | Stop-Process | |
| } | |
| } | Out-File pkill.log | |
| - name: Run Wush Action | |
| uses: ./ | |
| timeout-minutes: 1 | |
| - name: Check wush started | |
| shell: bash | |
| run: | | |
| if [ -f wush.log ]; then | |
| echo "wush was started" | |
| exit 0 | |
| else | |
| echo "wush was not started" | |
| exit 1 | |
| fi | |
| - name: Debug | |
| uses: ./ | |
| if: failure() | |
| timeout-minutes: 25 |