From 418f0f6de9a2f1bbfa140a4a741aec84d1ce66ee Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Sat, 12 Feb 2022 14:05:17 -0600 Subject: [PATCH] ci: Move smoke test to its own job --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++------ ci/SmokeTest.ps1 | 6 +++--- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9995f6d..3e643dc1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,20 +42,42 @@ jobs: shell: pwsh run: ci/Publish.ps1 ${{ matrix.runtime }} - - name: Smoke Test - shell: pwsh - run: ci/SmokeTest.ps1 ${{ matrix.runtime }} - if: ${{ endsWith(matrix.runtime, 'linux-x64') }} - - name: Upload Artifacts uses: actions/upload-artifact@v2 with: name: trash-${{ matrix.runtime }} path: publish/${{ matrix.runtime }}/* + smoke: + name: Smoke Test + needs: build + strategy: + fail-fast: false + matrix: + include: + - image: windows-latest + runtime: win-x64 + - image: ubuntu-latest + runtime: linux-x64 + - image: macos-latest + runtime: osx-x64 + runs-on: ${{ matrix.image }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + name: trash-${{ matrix.runtime }} + + - name: Run Smoke Test + shell: pwsh + run: ci/SmokeTest.ps1 ./trash + release: name: Release - needs: build + needs: smoke runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/v') steps: diff --git a/ci/SmokeTest.ps1 b/ci/SmokeTest.ps1 index d5610d3a..1a2f47dc 100644 --- a/ci/SmokeTest.ps1 +++ b/ci/SmokeTest.ps1 @@ -1,18 +1,18 @@ [CmdletBinding()] param ( [Parameter(Mandatory = $true)] - [string] $runtime + [string] $PathToTrashExe ) $ErrorActionPreference = "Stop" if (Get-Command chmod -errorAction SilentlyContinue) { "The chmod command was found. Setting read + execute permission." - & chmod +rx ./publish/$runtime/trash + & chmod +rx $PathToTrashExe } "Execute trash command to ensure basic functionality is working" -& .\publish\$runtime\trash -h +& $PathToTrashExe -h if ($LASTEXITCODE -ne 0) { "Trash executable failed to run with exit code: $LASTEXITCODE" exit -1