Skip to content

Commit

Permalink
do not calculate coverage on external PRs (Avaiga#2123)
Browse files Browse the repository at this point in the history
* do not calculate coverage on external PRs

* execute if same repo

---------

Co-authored-by: Fred Lefévère-Laoide <Fred.Lefevere-Laoide@Taipy.io>
  • Loading branch information
FredLL-Avaiga and Fred Lefévère-Laoide authored Oct 22, 2024
1 parent a900073 commit 3c5c915
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ jobs:
if: steps.cache-gui-fe-build.outputs.cache-hit != 'true'
run: npm ci

- if: steps.cache-gui-fe-build.outputs.cache-hit != 'true'
- name: Test Gui
if: steps.cache-gui-fe-build.outputs.cache-hit != 'true'
run: npm test

- name: Code coverage
if: matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' && steps.cache-gui-fe-build.outputs.cache-hit != 'true'
if: matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' && steps.cache-gui-fe-build.outputs.cache-hit != 'true' && github.event.pull_request.base.repo.full_name == github.event.pull_request.head.repo.full_name
uses: artiomtr/jest-coverage-report-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -128,6 +129,7 @@ jobs:
echo "HASH=$(cat hash.txt)" >> $GITHUB_OUTPUT
rm hash.txt
shell: bash

- name: Restore cached core frontend build
id: cache-gui-core-fe-build
uses: actions/cache@v4
Expand Down Expand Up @@ -157,7 +159,7 @@ jobs:
run: npm test

- name: Code coverage
if: matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' && steps.cache-gui-core-fe-build.outputs.cache-hit != 'true'
if: matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' && steps.cache-gui-core-fe-build.outputs.cache-hit != 'true' && github.event.pull_request.base.repo.full_name == github.event.pull_request.head.repo.full_name
uses: artiomtr/jest-coverage-report-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/overall-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
coverage:
timeout-minutes: 50
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
if: github.event_name == 'pull_request' && github.event.pull_request.base.repo.full_name == github.event.pull_request.head.repo.full_name
steps:
- uses: actions/checkout@v4

Expand Down

0 comments on commit 3c5c915

Please sign in to comment.