From 7478dec985dcad0dabca78efeb8986d82cce51ec Mon Sep 17 00:00:00 2001 From: Jason Gwartz Date: Wed, 21 Aug 2024 13:58:15 +0100 Subject: [PATCH] Verify output of invoking pkl in action test --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 195784e..c79c50a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,7 @@ jobs: matrix: # Right now macos-13 is amd64 while macos-14 is aarch64 (M1) os: [ubuntu-latest, macos-13, macos-14, windows-latest] + pkl_version: [0.26.0, 0.26.1, 0.26.2, 0.26.3] runs-on: ${{ matrix.os }} steps: @@ -60,8 +61,28 @@ jobs: id: test-action uses: ./ with: - pkl-version: 0.26.0 + pkl-version: ${{ matrix.pkl_version }} github-token: ${{ secrets.GITHUB_TOKEN }} - name: Confirm download - run: pkl --version + uses: mathiasvr/command-output@v2.0.0 + id: check-exec + with: + run: pkl --version + + - name: Verify stdout + uses: actions/github-script@v7 + env: + RESULT: ${{ steps.check-exec.outputs.stdout }} + PKL_VERSION: ${{ matrix.pkl_version }} + with: + script: | + const output = process.env.RESULT; + const pklVersion = process.env.PKL_VERSION; + const expectedStart = `Pkl ${pklVersion}` + console.log(`Output from executing pkl was: ${output}`) + if (output.startsWith(expectedStart)) { + console.log('Output starts with expected string:', expectedStart); + } else { + throw new Error('Output does not start with expected string:', expectedStart); + }