-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4508 from bcgov/test
Release 5.6
- Loading branch information
Showing
1,375 changed files
with
302,087 additions
and
16,283 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 |
---|---|---|
|
@@ -104,21 +104,16 @@ jobs: | |
cd .. | ||
head TestResults/coverage.opencover.xml | ||
- name: Codecov | ||
uses: codecov/[email protected] | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV }} | ||
- name: Save PR number and scan results | ||
run: | | ||
mkdir -p ./pr | ||
echo ${{ github.event.pull_request.number }} > ./pr/NR | ||
cp ${{env.working-directory}}/tests/unit/TestResults/coverage.opencover.xml ./pr | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
# User defined upload name. Visible in Codecov UI | ||
name: PIMS | ||
# Path to coverage file to upload | ||
file: ${{env.working-directory}}/tests/unit/TestResults/coverage.opencover.xml | ||
# Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome) | ||
flags: unittests | ||
# Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON) | ||
env_vars: C# | ||
# Specify whether or not CI build should fail if Codecov runs into an error during upload | ||
fail_ci_if_error: false | ||
name: pr-codecov | ||
path: pr/ | ||
|
||
- name: SonarScanner for .NET 8 with pull request decoration support | ||
id: scan | ||
|
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 |
---|---|---|
|
@@ -57,36 +57,30 @@ jobs: | |
env: | ||
REACT_APP_TENANT: MOTI | ||
|
||
- name: Codecov | ||
uses: codecov/[email protected] | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV }} | ||
- 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@v4 | ||
with: | ||
# User defined upload name. Visible in Codecov UI | ||
name: PIMS | ||
# Path to coverage file to upload | ||
file: ${{env.working-directory}}/coverage/coverage-final.json | ||
# Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome) | ||
flags: unittests | ||
# Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON) | ||
env_vars: javascript | ||
# Specify whether or not CI build should fail if Codecov runs into an error during upload | ||
fail_ci_if_error: false | ||
name: pr-codecov | ||
path: pr/ | ||
|
||
- name: SonarQube Scan | ||
id: scan | ||
uses: sonarsource/sonarqube-scan-action@master | ||
if: false | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ secrets.SONAR_URL }} | ||
PROJECT_KEY: ${{secrets.PROJECT_KEY_APP}} | ||
SONAR_HOST_URL: https://sonarqube-3cd915-tools.apps.silver.devops.gov.bc.ca/ | ||
PROJECT_KEY: 21faa627-fe70-4a67-89e3-1262a32d2e2c | ||
PROJECT_NAME: PIMS-APP | ||
with: | ||
projectBaseDir: ${{env.working-directory}} | ||
args: > | ||
-Dsonar.projectKey=${{env.PROJECT_KEY}} | ||
-Dsonar.projectName=${{env.PROJECT_NAME}} | ||
-Dsonar.projectKey=21faa627-fe70-4a67-89e3-1262a32d2e2c | ||
-Dsonar.projectName=PIMS-APP | ||
-Dsonar.qualitygate.wait=true | ||
# Send notifications only if MS_TEAMS_NOTIFY_URL secret has been set | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Codecov Comment on PR | ||
|
||
# read-write repo token | ||
# access to secrets | ||
on: | ||
workflow_run: | ||
workflows: ["API (.NET 8)", "APP (React)"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
upload: | ||
runs-on: ubuntu-latest | ||
if: > | ||
github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.event.workflow_run.head_repository.full_name }} | ||
ref: ${{ github.event.workflow_run.head_branch }} | ||
fetch-depth: 0 | ||
- name: "Download artifact" | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: ${{github.event.workflow_run.id }}, | ||
}); | ||
var matchArtifact = artifacts.data.artifacts.filter((artifact) => { | ||
return artifact.name == "pr-codecov" | ||
})[0]; | ||
var download = await github.rest.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: matchArtifact.id, | ||
archive_format: 'zip', | ||
}); | ||
var fs = require('fs'); | ||
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); | ||
- run: unzip pr.zip | ||
- name: "Comment on PR" | ||
id: create-comment | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
var fs = require('fs'); | ||
var issue_number = Number(fs.readFileSync('./NR')); | ||
await github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: issue_number, | ||
body: 'See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/' + issue_number | ||
}); | ||
return issue_number; | ||
result-encoding: string | ||
- name: Codecov(API) | ||
if: ${{ github.event.workflow_run.name == 'API (.NET 8)' }} | ||
uses: codecov/[email protected] | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV }} | ||
with: | ||
# User defined upload name. Visible in Codecov UI | ||
name: PIMS | ||
# Path to coverage file to upload | ||
file: ./coverage.opencover.xml | ||
# Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome) | ||
flags: unittests | ||
env_vars: C# | ||
# Specify whether or not CI build should fail if Codecov runs into an error during upload | ||
fail_ci_if_error: false | ||
override_pr: ${{steps.create-comment.outputs.result}} | ||
- name: Codecov(APP) | ||
if: ${{ github.event.workflow_run.name == 'APP (React)' }} | ||
uses: codecov/[email protected] | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV }} | ||
with: | ||
# User defined upload name. Visible in Codecov UI | ||
name: PIMS | ||
# Path to coverage file to upload | ||
file: ./coverage-final.json | ||
# Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome) | ||
flags: unittests | ||
# Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON) | ||
env_vars: javascript | ||
# Specify whether or not CI build should fail if Codecov runs into an error during upload | ||
fail_ci_if_error: false | ||
override_pr: ${{steps.create-comment.outputs.result}} |
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
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
Oops, something went wrong.