From b3a3747e13a44d2b11d194ec6d04d0f0a211de20 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Mon, 1 Aug 2022 12:47:30 -0400 Subject: [PATCH] this should work --- .github/workflows/electron_woa_testing.yml | 55 ++++++---------------- 1 file changed, 15 insertions(+), 40 deletions(-) diff --git a/.github/workflows/electron_woa_testing.yml b/.github/workflows/electron_woa_testing.yml index ecbf5c93d0d60..f4468c65a5342 100644 --- a/.github/workflows/electron_woa_testing.yml +++ b/.github/workflows/electron_woa_testing.yml @@ -11,40 +11,35 @@ on: required: true jobs: - electron-woa: - - runs-on: [self-hosted, woa] + electron-woa-init: + if: ${{ github.event_name == 'push' && github.repository == 'electron/electron' }} + runs-on: ubuntu-latest + steps: + - name: Dummy step for push event + run: | + echo "This job is a needed initialization step for Electron WOA testing. Another test result will appear once the electron-woa-testing build is done." + electron-woa-testing: + if: ${{ github.event_name == 'workflow_dispatch' && github.repository == 'electron/electron' }} + runs-on: [self-hosted, woa] permissions: checks: write pull-requests: write - steps: - - uses: LouisBrunner/checks-action@v1.1.1 - if: ${{ github.event_name == 'push' && github.repository == 'electron/electron' }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - name: electron-woa-testing - status: queued - details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - name: Clean Workspace - if: ${{ github.event_name == 'workflow_dispatch' }} run: | Remove-Item * -Recurse -Force shell: powershell - name: Checkout uses: actions/checkout@v3 - if: ${{ github.event_name == 'workflow_dispatch' }} with: path: src\electron fetch-depth: 0 - name: Yarn install - if: ${{ github.event_name == 'workflow_dispatch' }} run: | cd src\electron node script/yarn.js install --frozen-lockfile - name: Download and extract dist.zip for test - if: ${{ github.event_name == 'workflow_dispatch' }} run: | $localArtifactPath = "$pwd\dist.zip" $serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/dist.zip" @@ -52,14 +47,12 @@ jobs: & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -osrc\out\Default -y $localArtifactPath shell: powershell - name: Download and extract native test executables for test - if: ${{ github.event_name == 'workflow_dispatch' }} run: | $localArtifactPath = "src\out\Default\shell_browser_ui_unittests.exe" $serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/shell_browser_ui_unittests.exe" Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer ${{ secrets.APPVEYOR_TOKEN }}" } shell: powershell - name: Download and extract ffmpeg.zip for test - if: ${{ github.event_name == 'workflow_dispatch' }} run: | $localArtifactPath = "$pwd\ffmpeg.zip" $serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/ffmpeg.zip" @@ -67,7 +60,6 @@ jobs: & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -osrc\out\ffmpeg $localArtifactPath shell: powershell - name: Download node headers for test - if: ${{ github.event_name == 'workflow_dispatch' }} run: | $localArtifactPath = "src\node_headers.zip" $serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/node_headers.zip" @@ -76,7 +68,6 @@ jobs: & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y node_headers.zip shell: powershell - name: Download electron.lib for test - if: ${{ github.event_name == 'workflow_dispatch' }} run: | $localArtifactPath = "src\out\Default\electron.lib" $serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/electron.lib" @@ -99,13 +90,11 @@ jobs: # } # shell: powershell - name: Setup node headers - if: ${{ github.event_name == 'workflow_dispatch' }} run: | New-Item src\out\Default\gen\node_headers\Release -Type directory Copy-Item -path src\out\Default\electron.lib -destination src\out\Default\gen\node_headers\Release\node.lib shell: powershell - name: Run Electron Main process tests - if: ${{ github.event_name == 'workflow_dispatch' }} run: | cd src set npm_config_nodedir=%cd%\out\Default\gen\node_headers @@ -121,7 +110,7 @@ jobs: MOCHA_REPORTER: mocha-multi-reporters ELECTRON_SKIP_NATIVE_MODULE_TESTS: true - name: Run Electron Remote based tests - if: ${{ github.event_name == 'workflow_dispatch' && (success() || failure()) }} + if: ${{ success() || failure() }} run: | cd src set npm_config_nodedir=%cd%\out\Default\gen\node_headers @@ -136,40 +125,26 @@ jobs: MOCHA_REPORTER: mocha-multi-reporters ELECTRON_SKIP_NATIVE_MODULE_TESTS: true - name: Verify ffmpeg - if: ${{ github.event_name == 'workflow_dispatch' }} run: | cd src echo "Verifying non proprietary ffmpeg" python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg shell: cmd - name: Kill processes left running from last test run - if: ${{ github.event_name == 'workflow_dispatch' && (success() || failure()) || cancelled() }} + if: ${{ always() }} run: | Get-Process | Where Name -Like "electron*" | Stop-Process Get-Process | Where Name -Like "msedge*" | Stop-Process shell: powershell - name: Delete user app data directories - if: ${{ github.event_name == 'workflow_dispatch' && (success() || failure()) || cancelled() }} + if: ${{ always() }} run: | Remove-Item -path $env:APPDATA/Electron* -Recurse -Force -ErrorAction Ignore shell: powershell - uses: LouisBrunner/checks-action@v1.1.1 - if: ${{ github.event_name == 'workflow_dispatch' && (success() || failure()) || cancelled() }} + if: ${{ always() }} with: token: ${{ secrets.GITHUB_TOKEN }} name: electron-woa-testing conclusion: "${{ job.status }}" - details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - - name: Dummy step for push event - if: ${{ github.event_name == 'push' }} - run: | - echo "This step can be ignored" - - uses: LouisBrunner/checks-action@v1.1.1 - if: ${{ github.event_name == 'push' && (success() || failure()) || cancelled() }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - name: electron-woa-testing - conclusion: neutral - status: completed - output: | - {"summary":"Electron WOA Testing Initialized","text_description":"This job is a needed initialization step for Electron WOA testing. Another test result will appear once / electron-woa-testing.\n"} \ No newline at end of file + details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \ No newline at end of file