feat: support messag format #15
Workflow file for this run
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: Tests JSON | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
direct-from-repository-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Confirm execution without install/build | |
uses: ./ | |
with: | |
name: "Successful cucumber report direct from repository" | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
path: "**/cucumber-report.json" # This committed report should be a success | |
ubuntu-action-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: npm ci | |
- run: npm run cucumber || true | |
- run: npm run cucumber-ok || true | |
- run: npm run cucumber-undefined || true | |
- run: npm run cucumber-non-failed || true | |
- run: npm run cucumber-empty || true | |
- uses: ./ | |
name: "fail because of error" | |
with: | |
name: "failed cucumber report" | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
path: "**/cucumber-report.json" | |
- uses: ./ | |
name: "fail because of error (without number of error)" | |
with: | |
name: "failed (no number of error)" | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
path: "**/cucumber-report.json" | |
show-number-of-error-on-check-title: false | |
- uses: ./ | |
name: "fail because of error with all annotation" | |
with: | |
name: "failed with all annotation" | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
path: "**/cucumber-report.json" | |
show-number-of-error-on-check-title: false | |
annotation-status-on-undefined: notice | |
annotation-status-on-pending: notice | |
- uses: ./ | |
name: "fail because of undefined test" | |
with: | |
name: "failed because of undefined test" | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
path: "**/cucumber-report-non-failed.json" | |
check-status-on-undefined: "failure" | |
annotation-status-on-undefined: "failure" | |
- uses: ./ | |
name: "fail because of pending test" | |
with: | |
name: "failed because of pending test" | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
path: "**/cucumber-report-non-failed.json" | |
check-status-on-pending: "failure" | |
annotation-status-on-pending: "failure" | |
- uses: ./ | |
name: "neutral because of error" | |
with: | |
name: "neutral cucumber report" | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
path: "**/cucumber-report.json" | |
check-status-on-error: 'neutral' | |
annotation-status-on-error: 'warning' | |
- uses: ./ | |
name: "sucess because all is ok" | |
with: | |
name: "success cucumber report" | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
path: "**/cucumber-report-ok.json" | |
check-status-on-error: 'neutral' | |
annotation-status-on-error: 'warning' | |
- uses: ./ | |
id: success-with-empty-cucumber-report | |
name: "success with empty cucumber report" | |
with: | |
name: "success empty report" | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
path: "**/cucumber-report-empty.json" | |
- uses: ./ | |
name: "job with summary" | |
with: | |
name: "job with summary" | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
path: "**/cucumber-report.json" | |
show-global-summary-report: 'true' | |
- id: check-output | |
name: "check output for cucumber-report-empty.json" | |
if: steps.success-with-empty-cucumber-report.output.cucumber-report-empty_failed_scenarios != 0 | |
run: exit 1 | |
- uses: ./ | |
id: job-failed | |
continue-on-error: true | |
name: "fail job due to failed test" | |
with: | |
name: "fail job due to failed test" | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
path: "**/cucumber-report-non-failed.json" | |
check-status-on-pending: "failure" | |
annotation-status-on-pending: "failure" | |
number-of-test-error-to-fail-job: 1 | |
- name: 'check that job-failed outcome is failed' | |
if: steps.job-failed.outcome == 'failure' | |
run: exit 0 | |
- name: 'check that job-failed outcome is failed' | |
if: steps.job-failed.outcome != 'failure' | |
run: exit 1 |