-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a77b2e
commit c910051
Showing
1 changed file
with
53 additions
and
62 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,83 +5,74 @@ on: | |
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'packages/i18nify-js/**' | ||
|
||
jobs: | ||
coverage: | ||
name: CodeCov analysis on coverage | ||
# JOB to run change detection | ||
changes: | ||
runs-on: ubuntu-latest | ||
# Required permissions | ||
permissions: | ||
pull-requests: read | ||
outputs: | ||
modified: ${{ steps.filter.outputs.src }} | ||
steps: | ||
- uses: dorny/paths-filter@v3 | ||
id: changes | ||
id: filter | ||
with: | ||
filters: | | ||
src: | ||
- 'packages/i18nify-js/**' | ||
- name: Execute if 'packages/i18nify-js' folder was changed | ||
if: | | ||
steps.changes.outputs.src == 'true' && !(github.head_ref == 'changeset-release/master' && github.actor == 'rzpcibot') && !contains(github.event.head_commit.message, '[skip ci]') | ||
run: | | ||
steps: | ||
- name: Checkout Codebase | ||
uses: actions/checkout@v3 | ||
- name: Setup Node v20 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.3.1 | ||
- name: Setup Cache & Install Dependencies | ||
uses: bahmutov/[email protected] | ||
with: | ||
install-command: yarn --frozen-lockfile | ||
- name: Run Tests | ||
working-directory: packages/i18nify-js | ||
run: yarn test | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
fail_ci_if_error: false | ||
verbose: true | ||
- name: Upload Unit Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Unit Test Results | ||
path: src/coverage/**/*.xml | ||
- name: Skip if 'packages/i18nify-js' folder was not changed | ||
if: steps.changes.outputs.src == 'false' | ||
run: echo "No changes in 'packages/i18nify-js' folder, skipping validation" | ||
coverage: | ||
name: CodeCov analysis on coverage | ||
runs-on: ubuntu-latest | ||
needs: changes | ||
if: | | ||
!(github.head_ref == 'changeset-release/master' && github.actor == 'rzpcibot') && | ||
!contains(github.event.head_commit.message, '[skip ci]') && ${{ needs.changes.outputs.modified == 'true' }} | ||
steps: | ||
- name: Checkout Codebase | ||
uses: actions/checkout@v3 | ||
- name: Setup Node v20 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.3.1 | ||
- name: Setup Cache & Install Dependencies | ||
uses: bahmutov/[email protected] | ||
with: | ||
install-command: yarn --frozen-lockfile | ||
- name: Run Tests | ||
working-directory: packages/i18nify-js | ||
run: yarn test | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
fail_ci_if_error: false | ||
verbose: true | ||
- name: Upload Unit Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Unit Test Results | ||
path: src/coverage/**/*.xml | ||
|
||
publish-test-results: | ||
name: 'Publish Unit Tests Results' | ||
needs: coverage | ||
runs-on: ubuntu-latest | ||
# Only run if prereq jobs completed - successfully or not | ||
if: (success() || failure()) && ${{ needs.changes.outputs.modified == 'true' }} | ||
steps: | ||
- uses: dorny/paths-filter@v3 | ||
id: changes | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
filters: | | ||
src: | ||
- 'packages/i18nify-js/**' | ||
- name: Execute if 'packages/i18nify-js' folder was changed | ||
# Only run if prereq jobs completed - successfully or not | ||
if: | | ||
(success() || failure()) && steps.changes.outputs.src == 'true' | ||
run: | | ||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
path: artifacts | ||
path: artifacts | ||
|
||
- name: Publish Unit Test Results | ||
uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1.6 | ||
continue-on-error: true | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
files: artifacts/**/*.xml | ||
- name: Skip if 'packages/i18nify-js' folder was not changed | ||
if: steps.changes.outputs.src == 'false' | ||
run: echo "No changes in 'packages/i18nify-js' folder, skipping validation" | ||
- name: Publish Unit Test Results | ||
uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1.6 | ||
continue-on-error: true | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
files: artifacts/**/*.xml |