simplify doc #110
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: "wen/trigger" | |
test-config: | | |
{ | |
"entrypoint": "https://www.wikipedia.org/", | |
"variables": { | |
"hello": "test level" | |
} | |
} | |
stories: | | |
[ | |
{ | |
"slug": "new-test", | |
"test-config": { | |
"entrypoint": "https://www.ikea.com/fr/fr/", | |
"variables": { | |
"hello": "story level" | |
} | |
} | |
} | |
] | |
wait-for-results: "yes" | |
domain: "https://api-staging.heal.dev" | |
- name: Run Action | |
id: my-action_new_with_test_config | |
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" | |
- 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 | |
- name: Assert Result my-action_new_with_test_config | |
run: | | |
if [[ "${{ steps.my-action_new_with_test_config.outputs.execution-id }}" == "" ]]; then | |
echo "Action failed to return an execution ID." | |
exit 1 | |
fi |