diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 00000000..f44c819b --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,41 @@ +# GitHub Workflow for LifeSG libs + +This guide will breifly explain what how the GitHub workflow works for LifeSG and the necessary setups to get it working on another LifeSG GitHub repository. + +## <u>trigger-gitlab-pipeline.yml</u> + +This file is responsible for creating the GitHub workflow and the job that triggers the GitLab pipeline. + +-- + +## <u>Trigger Pipeline Job</u> + +When a GitHub `push on master branch` or `pull request` is made it will trigger the job. + +Pull Request events that will trigger the pipeline are: + +- `opened`: when opening of a PR +- `synchronize`: when a new commit is added to the PR +- `reopened`: when reopening of a PR + +We have set variables in the settings of the GitHub repository that is needed to be passed into the trigger pipeline API. + +These variables are: + +- GITLAB_TOKEN - The token created in GitLab to authenticate the use of the API +- GITLAB_ENDPOINT - The host domain of GitLab +- GITLAB_PROJECT_ID - The project ID of the GitLab pipeline that builds the lib +- GITLAB_REPO_NAME - The name of the repository being built + +The job will make a `curl` to the GitLab pipeline trigger API. + +The API contains variables that are important to be passed in the body of the request: + +- PIPELINE_PROJECT_NAME - the repo name +- PIPELINE_PROJECT_URL - the github url of the repo +- PIPELINE_EVENT - the workflow trigger event type +- PIPELINE_BRANCH_NAME - the branch being built +- PIPELINE_TRIGGER_PERSON - the person that triggered the workflow +- PIPELINE_COMMIT_MSG - the 1st line of the commit message + +Then the Project in GitLab responsible for running the pipeline will create and start the pipeline. diff --git a/.github/workflows/trigger-gitlab-pipeline.yml b/.github/workflows/trigger-gitlab-pipeline.yml new file mode 100644 index 00000000..a88c1edc --- /dev/null +++ b/.github/workflows/trigger-gitlab-pipeline.yml @@ -0,0 +1,89 @@ +name: Trigger GitLab CI Pipeline + +on: + push: + branches: + - master + - "release/**" + - "!release/**-published" + pull_request: + types: [opened, synchronize, reopened] + +jobs: + trigger_pipeline: + runs-on: ubuntu-latest + + steps: + - name: Print Configs + run: | + [[ $GITHUB_EVENT_NAME = "pull_request" ]] && BRANCH_NAME="${{ github.head_ref }}" || BRANCH_NAME="${{ github.ref_name }}" + + [[ $GITHUB_EVENT_NAME = "pull_request" ]] && COMMIT_MSG="${{ github.event.pull_request.title }}" || COMMIT_MSG=$(echo -e "${{ github.event.head_commit.message }}" | head -n 1) + + PIPELINE_PROJECT_URL="github.com/$GITHUB_REPOSITORY.git" + + echo "BRANCH_NAME=$BRANCH_NAME" >> "$GITHUB_ENV" + echo "COMMIT_MSG=$COMMIT_MSG" >> "$GITHUB_ENV" + echo "PIPELINE_PROJECT_URL=$PIPELINE_PROJECT_URL" >> "$GITHUB_ENV" + + echo "PIPELINE_PROJECT_URL: $PIPELINE_PROJECT_URL" + echo "PIPELINE_EVENT: $GITHUB_EVENT_NAME" + echo "PIPELINE_BRANCH_NAME: $BRANCH_NAME" + echo "PIPELINE_TRIGGER_PERSON: $GITHUB_ACTOR" + echo "PIPELINE_COMMIT_MSG: $COMMIT_MSG" + + - name: Trigger GitLab Pipeline + env: + GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} + GITLAB_ENDPOINT: ${{ vars.GITLAB_ENDPOINT }} + GITLAB_PROJECT_ID: ${{ vars.GITLAB_PROJECT_ID }} + GITLAB_REPO_NAME: ${{ vars.GITLAB_REPO_NAME }} + run: | + response=$(curl -sS --request POST \ + --fail \ + --form token=$GITLAB_TOKEN \ + --form "ref=main" \ + --form "variables[PIPELINE_PROJECT_NAME]=$GITLAB_REPO_NAME" \ + --form "variables[PIPELINE_PROJECT_URL]=$PIPELINE_PROJECT_URL" \ + --form "variables[PIPELINE_EVENT]=$GITHUB_EVENT_NAME" \ + --form "variables[PIPELINE_BRANCH_NAME]=$BRANCH_NAME" \ + --form "variables[PIPELINE_TRIGGER_PERSON]=$GITHUB_ACTOR" \ + --form "variables[PIPELINE_COMMIT_MSG]=$COMMIT_MSG" \ + --url "$GITLAB_ENDPOINT/$GITLAB_PROJECT_ID/trigger/pipeline") + + echo "Pipeline URL: $(echo $response | jq -r '.web_url')" + + PIPELINE_ID=$(echo $response | jq -r '.id') + echo "PIPELINE_ID=$PIPELINE_ID" >> "$GITHUB_ENV" + + echo "Pipeline ID: $PIPELINE_ID" + + - name: Check GitLab Pipeline + env: + GITLAB_PAT: ${{ secrets.GITLAB_PAT }} + GITLAB_ENDPOINT: ${{ vars.GITLAB_ENDPOINT }} + GITLAB_PROJECT_ID: ${{ vars.GITLAB_PROJECT_ID }} + SLEEP_DURATION_MINUTES: 15 + CHECK_INTERVAL_MINUTES: 5 + run: | + echo "Pipeline ID: $PIPELINE_ID" + echo "[ Running pipline check after $SLEEP_DURATION_MINUTES minutes ]" + sleep $(($SLEEP_DURATION_MINUTES*60)) + + pipeline_status="" + until [[ $pipeline_status == "success" || $pipeline_status == "failed" || $pipeline_status == "canceled" || $pipeline_status == "skipped" ]] + do + pipeline_status=$(curl -sS --request GET --header "PRIVATE-TOKEN: $GITLAB_PAT" --url "$GITLAB_ENDPOINT/$GITLAB_PROJECT_ID/pipelines/$PIPELINE_ID" | jq -r '.status') + + echo "Pipeline status: $pipeline_status" + + sleep $(($CHECK_INTERVAL_MINUTES*60)) + done + + [[ $pipeline_status == "canceled" ]] && echo "GitLab Pipeline was cancelled" + + [[ $pipeline_status == "skipped" ]] && echo "GitLab pipeline has stopped, please head to the GitLab pipeline to trigger job manually" + + [[ $pipeline_status == "failed" ]] && echo "GitLab pipeline has failed, please head to the GitLab pipeline to check on error" && exit 1 + + [[ $pipeline_status == "success" ]] && echo "GitLab pipeline is successfully completed, please head to the GitLab pipeline for further deployments" diff --git a/.gitignore b/.gitignore index 27d52508..4f033a9d 100644 --- a/.gitignore +++ b/.gitignore @@ -246,6 +246,7 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + # Runtime data pids *.pid @@ -646,3 +647,4 @@ $RECYCLE.BIN/ dist jest.json +junit.xml diff --git a/package-lock.json b/package-lock.json index 383b847f..29e3e3a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,6 +34,7 @@ "husky": "^8.0.3", "jest": "^29.6.2", "jest-bamboo-reporter": "^1.3.0", + "jest-junit": "^16.0.0", "lint-staged": "^13.2.3", "nock": "^13.3.2", "shelljs": "~0.8.5", @@ -1681,9 +1682,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001517", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz", - "integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==", + "version": "1.0.30001519", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001519.tgz", + "integrity": "sha512-0QHgqR+Jv4bxHMp8kZ1Kn8CH55OikjKJ6JmKkZYP1F3D7w+lnFXF70nG5eNfsZS89jadi5Ywy5UCSKLAglIRkg==", "dev": true, "funding": [ { @@ -1952,9 +1953,9 @@ } }, "node_modules/dedent": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.0.tgz", - "integrity": "sha512-3sSQTYoWKGcRHmHl6Y6opLpRJH55bxeGQ0Y1LCI5pZzUXvokVkj0FC4bi7uEwazxA9FQZ0Nv067Zt5kSUvXxEA==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", "dev": true, "peerDependencies": { "babel-plugin-macros": "^3.1.0" @@ -2109,9 +2110,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.477", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.477.tgz", - "integrity": "sha512-shUVy6Eawp33dFBFIoYbIwLHrX0IZ857AlH9ug2o4rvbWmpaCUdBpQ5Zw39HRrfzAFm4APJE9V+E2A/WB0YqJw==", + "version": "1.4.482", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.482.tgz", + "integrity": "sha512-h+UqpfmEr1Qkk0zp7ej/jid7CXoq4m4QzW6wNTb0ELJ/BZCpA4wgUylBIMGCe621tnr4l5VmoHjdoSx2lbnNJA==", "dev": true }, "node_modules/emittery": { @@ -2458,13 +2459,13 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "node_modules/handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "dev": true, "dependencies": { "minimist": "^1.2.5", - "neo-async": "^2.6.0", + "neo-async": "^2.6.2", "source-map": "^0.6.1", "wordwrap": "^1.0.0" }, @@ -3080,6 +3081,21 @@ "fsevents": "^2.3.2" } }, + "node_modules/jest-junit": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-16.0.0.tgz", + "integrity": "sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==", + "dev": true, + "dependencies": { + "mkdirp": "^1.0.4", + "strip-ansi": "^6.0.1", + "uuid": "^8.3.2", + "xml": "^1.0.1" + }, + "engines": { + "node": ">=10.12.0" + } + }, "node_modules/jest-leak-detector": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.2.tgz", @@ -4123,15 +4139,15 @@ } }, "node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "dev": true, - "dependencies": { - "minimist": "^1.2.6" - }, "bin": { "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/ms": { @@ -4224,6 +4240,14 @@ "uuid": "^9.0.0" } }, + "node_modules/node-jose/node_modules/uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/node-releases": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", @@ -5550,6 +5574,18 @@ "node": "*" } }, + "node_modules/tslint/node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, "node_modules/tslint/node_modules/semver": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", @@ -5681,9 +5717,10 @@ } }, "node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, "bin": { "uuid": "dist/bin/uuid" } @@ -5838,6 +5875,12 @@ "node": ">=0.8" } }, + "node_modules/xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", + "dev": true + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -7219,9 +7262,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001517", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz", - "integrity": "sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==", + "version": "1.0.30001519", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001519.tgz", + "integrity": "sha512-0QHgqR+Jv4bxHMp8kZ1Kn8CH55OikjKJ6JmKkZYP1F3D7w+lnFXF70nG5eNfsZS89jadi5Ywy5UCSKLAglIRkg==", "dev": true }, "chalk": { @@ -7412,9 +7455,9 @@ } }, "dedent": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.0.tgz", - "integrity": "sha512-3sSQTYoWKGcRHmHl6Y6opLpRJH55bxeGQ0Y1LCI5pZzUXvokVkj0FC4bi7uEwazxA9FQZ0Nv067Zt5kSUvXxEA==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", "dev": true }, "deepmerge": { @@ -7520,9 +7563,9 @@ } }, "electron-to-chromium": { - "version": "1.4.477", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.477.tgz", - "integrity": "sha512-shUVy6Eawp33dFBFIoYbIwLHrX0IZ857AlH9ug2o4rvbWmpaCUdBpQ5Zw39HRrfzAFm4APJE9V+E2A/WB0YqJw==", + "version": "1.4.482", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.482.tgz", + "integrity": "sha512-h+UqpfmEr1Qkk0zp7ej/jid7CXoq4m4QzW6wNTb0ELJ/BZCpA4wgUylBIMGCe621tnr4l5VmoHjdoSx2lbnNJA==", "dev": true }, "emittery": { @@ -7763,13 +7806,13 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "dev": true, "requires": { "minimist": "^1.2.5", - "neo-async": "^2.6.0", + "neo-async": "^2.6.2", "source-map": "^0.6.1", "uglify-js": "^3.1.4", "wordwrap": "^1.0.0" @@ -8202,6 +8245,18 @@ "walker": "^1.0.8" } }, + "jest-junit": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-16.0.0.tgz", + "integrity": "sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==", + "dev": true, + "requires": { + "mkdirp": "^1.0.4", + "strip-ansi": "^6.0.1", + "uuid": "^8.3.2", + "xml": "^1.0.1" + } + }, "jest-leak-detector": { "version": "29.6.2", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.2.tgz", @@ -8994,13 +9049,10 @@ "dev": true }, "mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "requires": { - "minimist": "^1.2.6" - } + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true }, "ms": { "version": "2.1.2", @@ -9070,6 +9122,13 @@ "pako": "^2.0.4", "process": "^0.11.10", "uuid": "^9.0.0" + }, + "dependencies": { + "uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" + } } }, "node-releases": { @@ -9989,6 +10048,15 @@ "brace-expansion": "^1.1.7" } }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "requires": { + "minimist": "^1.2.6" + } + }, "semver": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", @@ -10094,9 +10162,10 @@ } }, "uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true }, "v8-compile-cache-lib": { "version": "3.0.1", @@ -10220,6 +10289,12 @@ "integrity": "sha512-8IfgFctB7fkvqkTGF2MnrDrC6vzE28Wcc1aSbdDQ+4/WFtzfS73YuapbuaPZwGqpR2e0EeDMIrFOJubQVLWFNA==", "dev": true }, + "xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", + "dev": true + }, "y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 06ece193..d9d9b2bb 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "husky": "^8.0.3", "jest": "^29.6.2", "jest-bamboo-reporter": "^1.3.0", + "jest-junit": "^16.0.0", "lint-staged": "^13.2.3", "nock": "^13.3.2", "shelljs": "~0.8.5", diff --git a/shared-config/jest.config.js b/shared-config/jest.config.js index 94bddbfa..0fd0f59c 100644 --- a/shared-config/jest.config.js +++ b/shared-config/jest.config.js @@ -34,6 +34,15 @@ exports.createBaseConfig = (testType) => { setupFiles: ["<rootDir>/shared-config/jest.setup.ts"], verbose: true, bail: true, + reporters: [ + "default", + [ + "jest-junit", + { + outputName: "junit.xml" + } + ] + ], }; return config;