Skip to content

v1

v1 #45

Workflow file for this run

name: CI
on: [push]
jobs:
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
id: echo-test
with:
test-name: "echo test"
setup-command: "echo 'Getting Setup'"
command: "echo 'Hello, World'"
expected-output: "Hello, World"
comparison-method: "contains"
- uses: ./
id: cat-test
with:
test-name: "cat test"
setup-command: "echo 'Getting Setup'"
command: "cat"
input: "from stdin"
expected-output: "from stdin"
comparison-method: "contains"
- name: Decode and assert echo-test
uses: actions/github-script@v6
with:
github-token: 123
script: |
// Decode the Base64 output
const decodedResult = Buffer.from("${{ steps.echo-test.outputs.result }}", 'base64').toString('utf8');
console.log(`Decoded Result: ${decodedResult}`);
const json = JSON.parse(decodedResult)
if ( json["version"] != 1 &&
json["status"] != "pass" &&
json["tests"][0]["name"] != "echo test") {
throw new Error(`Assertion failed. Expected 'expected value', but got '${decodedResult}'`);
}
- name: Decode and assert cat-test
uses: actions/github-script@v6
with:
github-token: 123
script: |
// Decode the Base64 output
const decodedResult = Buffer.from("${{ steps.cat-test.outputs.result }}", 'base64').toString('utf8');
console.log(`Decoded Result: ${decodedResult}`);
const json = JSON.parse(decodedResult)
if ( json["version"] != 1 &&
json["status"] != "pass" &&
json["tests"][0]["name"] != "cat test" &&
json["tests"][0]["test_code"] != 'cat <stdin>from stdin') {
throw new Error(`Assertion failed. Expected 'expected value', but got '${decodedResult}'`);
}