Skip to content

Commit

Permalink
add win and mac (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrybyk authored Jan 31, 2024
1 parent 582910e commit bc1bf03
Show file tree
Hide file tree
Showing 6 changed files with 221 additions and 82 deletions.
115 changes: 112 additions & 3 deletions .github/workflows/report_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ concurrency:
cancel-in-progress: true # cancel jobs in progress

jobs:
test:
test-ubuntu:
timeout-minutes: 180
runs-on: ubuntu-latest
name: Build, Test, Report
name: Build, Test, Report in Ubuntu

steps:
# To use this repository's private action,
Expand Down Expand Up @@ -83,6 +83,115 @@ jobs:
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Ubuntu run:
${{ steps.self_test.outputs.test_result_icon }} [Allure Report](${{ steps.self_test.outputs.report_url }}) | ${{ steps.self_test.outputs.test_result_passed }}/${{ steps.self_test.outputs.test_result_failed }}/${{ steps.self_test.outputs.test_result_total }} | [History](${{ steps.self_test.outputs.report_history_url }})
comment_tag: allure_self_test
comment_tag: allure_self_test_ubuntu
mode: recreate

test-win:
timeout-minutes: 180
runs-on: windows-latest
name: Build, Test, Report in Windows

steps:
# To use this repository's private action,
# you must check out the repository
- uses: actions/checkout@v4

- run: npm ci --no-fund --no-audit --no-progress
- run: npm run build
- run: npx playwright install --with-deps chromium

- name: Run e2e and ignore snapshots update
run: npm run e2e -- --update-snapshots

- name: Checkout gh-pages
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: gh-pages # branch name
path: gh-pages-dir # checkout path

- name: Local Allure Report Action
uses: ./ # Uses an action in the root directory
if: always()
continue-on-error: true
id: self_test # used in comment to PR
with:
report_id: 'self-test'
gh_pages: 'gh-pages-dir'
report_dir: 'allure-results'
list_dirs: ${{ github.ref == 'refs/heads/main' }}

- name: Git Commit and Push Action
uses: mgrybyk/git-commit-pull-push-action@v1
if: always()
with:
repository: gh-pages-dir
branch: gh-pages

- name: Comment PR with Allure Report link
if: ${{ always() && github.event_name == 'pull_request' && steps.self_test.outputs.report_url }}
continue-on-error: true
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Windows run:
${{ steps.self_test.outputs.test_result_icon }} [Allure Report](${{ steps.self_test.outputs.report_url }}) | ${{ steps.self_test.outputs.test_result_passed }}/${{ steps.self_test.outputs.test_result_failed }}/${{ steps.self_test.outputs.test_result_total }} | [History](${{ steps.self_test.outputs.report_history_url }})
comment_tag: allure_self_test_windows
mode: recreate

test-mac:
timeout-minutes: 180
runs-on: macos-latest
name: Build, Test, Report in macOS

steps:
# To use this repository's private action,
# you must check out the repository
- uses: actions/checkout@v4

- run: npm ci --no-fund --no-audit --no-progress
- run: npm run build
- run: npx playwright install --with-deps chromium

- name: Run e2e and ignore snapshots update
run: npm run e2e -- --update-snapshots

- name: Checkout gh-pages
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: gh-pages # branch name
path: gh-pages-dir # checkout path

- name: Local Allure Report Action
uses: ./ # Uses an action in the root directory
if: always()
continue-on-error: true
id: self_test # used in comment to PR
with:
report_id: 'self-test'
gh_pages: 'gh-pages-dir'
report_dir: 'allure-results'
list_dirs: ${{ github.ref == 'refs/heads/main' }}

- name: Git Commit and Push Action
uses: mgrybyk/git-commit-pull-push-action@v1
if: always()
with:
repository: gh-pages-dir
branch: gh-pages

- name: Comment PR with Allure Report link
if: ${{ always() && github.event_name == 'pull_request' && steps.self_test.outputs.report_url }}
continue-on-error: true
uses: thollander/actions-comment-pull-request@v2
with:
message: |
macOS run:
${{ steps.self_test.outputs.test_result_icon }} [Allure Report](${{ steps.self_test.outputs.report_url }}) | ${{ steps.self_test.outputs.test_result_passed }}/${{ steps.self_test.outputs.test_result_failed }}/${{ steps.self_test.outputs.test_result_total }} | [History](${{ steps.self_test.outputs.report_history_url }})
comment_tag: allure_self_test_macos
mode: recreate
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ See examples:
- [Allure History List](https://mgrybyk.github.io/allure-report-branch-js-action/allure-js-action/main/self-test/)
- [Allure Report](https://mgrybyk.github.io/allure-report-branch-js-action/allure-js-action/main/self-test/5931206129_1692650191550/)
- [Browse different branches](https://mgrybyk.github.io/allure-report-branch-js-action/allure-js-action/)
- [Pull Request Comment Example](https://github.com/mgrybyk/allure-report-branch-js-action/pull/2)
- [Pull Request Comment Example](https://github.com/mgrybyk/allure-report-branch-js-action/pull/3)

*Compatible with [HTML Trend Report Action](https://github.com/marketplace/actions/publish-report-per-branch).*

Expand Down
Loading

0 comments on commit bc1bf03

Please sign in to comment.