Skip to content

Commit 7478dec

Browse files
committed
Verify output of invoking pkl in action test
1 parent d4570cb commit 7478dec

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
matrix:
5050
# Right now macos-13 is amd64 while macos-14 is aarch64 (M1)
5151
os: [ubuntu-latest, macos-13, macos-14, windows-latest]
52+
pkl_version: [0.26.0, 0.26.1, 0.26.2, 0.26.3]
5253
runs-on: ${{ matrix.os }}
5354

5455
steps:
@@ -60,8 +61,28 @@ jobs:
6061
id: test-action
6162
uses: ./
6263
with:
63-
pkl-version: 0.26.0
64+
pkl-version: ${{ matrix.pkl_version }}
6465
github-token: ${{ secrets.GITHUB_TOKEN }}
6566

6667
- name: Confirm download
67-
run: pkl --version
68+
uses: mathiasvr/command-output@v2.0.0
69+
id: check-exec
70+
with:
71+
run: pkl --version
72+
73+
- name: Verify stdout
74+
uses: actions/github-script@v7
75+
env:
76+
RESULT: ${{ steps.check-exec.outputs.stdout }}
77+
PKL_VERSION: ${{ matrix.pkl_version }}
78+
with:
79+
script: |
80+
const output = process.env.RESULT;
81+
const pklVersion = process.env.PKL_VERSION;
82+
const expectedStart = `Pkl ${pklVersion}`
83+
console.log(`Output from executing pkl was: ${output}`)
84+
if (output.startsWith(expectedStart)) {
85+
console.log('Output starts with expected string:', expectedStart);
86+
} else {
87+
throw new Error('Output does not start with expected string:', expectedStart);
88+
}

0 commit comments

Comments
 (0)