[GitHub action] Allow for test-config at the suite-level #90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "testcitriggers/heal-core-functions" | |
test-config: | | |
{ | |
"entrypoint": "https://app-staging.heal.dev", | |
"variables": { | |
"blockName": "Test block" | |
} | |
} | |
stories: | | |
[ | |
{ | |
"slug": "create-a-story-with-left-click", | |
} | |
] | |
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 |