PIMS-2362 Project Cost Calculation #1787
This file contains hidden or 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
| name: Express API - Jest Test Coverage | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] # Triggered by opened or changed pull requests. | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/api-jest-coverage.yaml' | |
| - 'express-api/**' # Triggers on changes to files in the express-api/ directory. | |
| - '!express-api/.eslintrc.cjs' # Will not trigger on changes to the following. | |
| - '!express-api/.gitignore' | |
| - '!express-api/prettierrc.cjs' | |
| - '!express-api/Dockerfile*' | |
| - '!express-api/tsconfig.json' | |
| - '!express-api/README.md' | |
| jobs: | |
| jest-coverage: | |
| runs-on: ubuntu-latest | |
| env: | |
| GIT_BRANCH: ${{ github.event.pull_request.head.ref }} | |
| GIT_COMMIT_SHA: ${{ github.event.pull_request.head.sha }} | |
| FRONTEND_URL: ${{ secrets.FRONTEND_URL }} | |
| BACKEND_URL: ${{ secrets.BACKEND_URL }} | |
| SSO_CLIENT_ID: ${{ secrets.SSO_CLIENT_ID }} | |
| SSO_CLIENT_SECRET: ${{ secrets.SSO_CLIENT_SECRET }} | |
| LTSA_AUTH_URL: ${{ secrets.LTSA_AUTH_URL }} | |
| LTSA_HOST_URL: ${{ secrets.LTSA_HOST_URL }} | |
| LTSA_INTEGRATOR_USERNAME: ${{ secrets.LTSA_INTEGRATOR_USERNAME }} | |
| LTSA_INTEGRATOR_PASSWORD: ${{ secrets.LTSA_INTEGRATOR_PASSWORD }} | |
| LTSA_USERNAME: ${{ secrets.LTSA_USERNAME }} | |
| LTSA_PASSWORD: ${{ secrets.LTSA_PASSWORD }} | |
| steps: | |
| # Confirm GitHub ENVs. | |
| - name: Echo ENVs | |
| run: | | |
| echo $GIT_BRANCH | |
| echo $GIT_COMMIT_SHA | |
| # Checkout code from Repo. | |
| - name: Checkout Repo | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| # Install dependencies. | |
| - name: Install Dependencies | |
| working-directory: ./express-api | |
| run: | | |
| npm i | |
| # Generate coverage report. | |
| - name: Run Coverage Report | |
| working-directory: ./express-api | |
| run: | | |
| npm test |