Skip to content

Commit

Permalink
Update workflow to report to report portal
Browse files Browse the repository at this point in the history
  • Loading branch information
hientominh committed Apr 8, 2024
1 parent bb96df9 commit 0df51d5
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 4 deletions.
61 changes: 58 additions & 3 deletions .github/workflows/jan-electron-linter-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 38,7 @@ on:

jobs:
test-on-macos:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: [self-hosted, macOS, macos-desktop]
steps:
- name: Getting the repo
Expand All @@ -54,6 54,22 @@ jobs:
run: |
make clean
- name: Get Commit Message for PR
if : github.event_name == 'pull_request'
run: |
MSG=$(git log --format=%B -n 1 ${{github.event.after}})
echo "COMMIT_MESSAGE=${MSG}" >> $GITHUB_ENV
- name: Get Commit Message for push event
if : github.event_name == 'push'
run: |
MSG=$(git log --format=%B -n 1 ${{github.sha}})
echo "COMMIT_MESSAGE=${MSG}" >> $GITHUB_ENV
- name: "Config report portal"
run: |
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App macos" REPORT_PORTAL_DESCRIPTION="${{env.COMMIT_MESSAGE}}"
- name: Linter and test
run: |
npm config set registry ${{ secrets.NPM_PROXY }} --global
Expand Down Expand Up @@ -112,6 128,17 @@ jobs:
continue-on-error: true
run: |
make clean
- name: Get Commit Message for push event
if : github.event_name == 'push'
run: |
MSG=$(git log --format=%B -n 1 ${{github.sha}})
echo "COMMIT_MESSAGE=${MSG}" >> $GITHUB_ENV
- name: "Config report portal"
shell: bash
run: |
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Windows ${{ matrix.antivirus-tools }}" REPORT_PORTAL_DESCRIPTION="${{env.COMMIT_MESSAGE}}"
- name: Linter and test
shell: powershell
Expand Down Expand Up @@ -142,6 169,17 @@ jobs:
run: |
make clean
- name: Get Commit Message for PR
if : github.event_name == 'pull_request'
run: |
MSG=$(git log --format=%B -n 1 ${{github.event.after}})
echo "COMMIT_MESSAGE=${MSG}" >> $GITHUB_ENV
- name: "Config report portal"
shell: bash
run: |
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Windows" REPORT_PORTAL_DESCRIPTION="${{env.COMMIT_MESSAGE}}"
- name: Linter and test
shell: powershell
run: |
Expand Down Expand Up @@ -182,7 220,7 @@ jobs:
test-on-ubuntu:
runs-on: [self-hosted, Linux, ubuntu-desktop]
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Getting the repo
uses: actions/checkout@v3
Expand All @@ -196,7 234,24 @@ jobs:
continue-on-error: true
run: |
make clean
- name: Get Commit Message for PR
if : github.event_name == 'pull_request'
run: |
MSG=$(git log --format=%B -n 1 ${{github.event.after}})
echo "COMMIT_MESSAGE=${MSG}" >> $GITHUB_ENV
- name: Get Commit Message for push event
if : github.event_name == 'push'
run: |
MSG=$(git log --format=%B -n 1 ${{github.sha}})
echo "COMMIT_MESSAGE=${MSG}" >> $GITHUB_ENV
- name: "Config report portal"
shell: bash
run: |
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Linux" REPORT_PORTAL_DESCRIPTION="${{env.COMMIT_MESSAGE}}"
- name: Linter and test
run: |
export DISPLAY=$(w -h | awk 'NR==1 {print $2}')
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 98,7 @@ else
],\n\
description: '$(REPORT_PORTAL_DESCRIPTION)',\n\
}\n$$(cat electron/playwright.config.ts)" > electron/playwright.config.ts;
sed -i '' "s|^ reporter: .*| reporter: [['@reportportal\/agent-js-playwright', RPconfig]],|" playwright.config.ts
sed -i '' "s|^ reporter: .*| reporter: [['@reportportal\/agent-js-playwright', RPconfig]],|" electron/playwright.config.ts
endif

# Testing
Expand Down

0 comments on commit 0df51d5

Please sign in to comment.