Skip to content

Merge pull request #5130 from asanchezr/psp-10960-shape-upload #16615

Merge pull request #5130 from asanchezr/psp-10960-shape-upload

Merge pull request #5130 from asanchezr/psp-10960-shape-upload #16615

Workflow file for this run

name: APP (React)
env:
# Default: ignore lifecycle scripts for *all* npm install commands in this workflow
npm_config_ignore_scripts: true
on:
push:
branches: [master, dev, test]
pull_request:
branches: [master, dev, test]
merge_group:
types: [checks_requested]
jobs:
# JOB to run change detection
check-changes:
runs-on: ubuntu-22.04
# Set job outputs to values from filter step
outputs:
frontend: ${{ steps.filter.outputs.frontend }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: dorny/paths-filter@7267a8516b6f92bdb098633497bad573efdbf271 # v2.12.0
id: filter
with:
filters: |
frontend:
- 'source/frontend/**'
build-frontend:
needs: check-changes
if: ${{ needs.check-changes.outputs.frontend == 'true' }}
runs-on: ubuntu-22.04
env:
CI: true
working-directory: ./source/frontend
GIT_BRANCH: "${{github.ref}}"
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Extract Branch Name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
id: extract_branch
- name: Use Node.js
uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3
with:
node-version: "20.11.1"
- run: npm ci
working-directory: ${{env.working-directory}}
- run: npm run lint
working-directory: ${{env.working-directory}}
- run: npm run build --if-present
working-directory: ${{env.working-directory}}
- run: npm run coverage -- --bail 1 --maxWorkers 2 --minWorkers 2
working-directory: ${{env.working-directory}}
env:
REACT_APP_TENANT: MOTI
- name: Save PR number and scan results
run: |
mkdir -p ./pr
echo ${{ github.event.pull_request.number }} > ./pr/NR
cp ${{env.working-directory}}/coverage/coverage-final.json ./pr
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: pr-codecov
path: pr/
# Send notifications only if MS_TEAMS_NOTIFY_URL secret has been set
- name: Failure notification to Teams Channel
env:
MS_TEAMS_NOTIFY_URL: ${{ secrets.MS_TEAMS_NOTIFY_URL }}
if: env.MS_TEAMS_NOTIFY_URL != '' && failure()
uses: dragos-cojocari/ms-teams-notification@bdee8c5584729d6a2dcaad8fc21ecfd40d1418ab # v1.0.2
with:
github-token: ${{ github.token }}
ms-teams-webhook-uri: ${{ env.MS_TEAMS_NOTIFY_URL }}
notification-summary: PIMS APP FAILED in ${{env.GIT_BRANCH}} environment
notification-color: ff0000
timezone: America/Los_Angeles