Skip to content

[GitHub action] Allow for test-config at the suite-level #100

[GitHub action] Allow for test-config at the suite-level

[GitHub action] Allow for test-config at the suite-level #100

Workflow file for this run

name: Test Action
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
automated-tests:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: npm
- name: Download deps
run: npm ci
- name: Run automated tests
run: npm test
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Run Action
id: my-action_old
uses: ./
with:
api-token: ${{ secrets.HEAL_API_TOKEN }}
suite-id: "455"
wait-for-results: "yes"
domain: "https://api-staging.heal.dev"
comment-on-pr: "yes"
- name: Run Action
id: my-action_new
uses: ./
with:
api-token: ${{ secrets.HEAL_API_TOKEN }}
suite: "wen/trigger"
test-config: |
{
"entrypoint": "https://www.wikipedia.org/",
"variables": {
"hello": "you"
}
}
stories: |
[
{
"slug": "new-test"
}
]
wait-for-results: "yes"
domain: "https://api-staging.heal.dev"
comment-on-pr: "yes"
- name: Assert Result my-action_old
run: |
if [[ "${{ steps.my-action_old.outputs.execution-id }}" == "" ]]; then
echo "Action failed to return an execution ID."
exit 1
fi
- name: Assert Result my-action_new
run: |
if [[ "${{ steps.my-action_new.outputs.execution-id }}" == "" ]]; then
echo "Action failed to return an execution ID."
exit 1
fi