Skip to content

Commit 278c16b

Browse files
authored
Merge pull request #4613 from bcgov/test
v5.7.2-96.22 release
2 parents 9939f5f + f8e1f86 commit 278c16b

File tree

1,643 files changed

+340458
-17417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,643 files changed

+340458
-17417
lines changed

.github/workflows/api-dotnetcore.yml

+45-17
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
# JOB to run change detection
1111
check-changes:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-22.04
1313
# Set job outputs to values from filter step
1414
outputs:
1515
backend: ${{ steps.filter.outputs.backend }}
@@ -24,12 +24,24 @@ jobs:
2424
2525
build-backend:
2626
needs: check-changes
27+
runs-on: ubuntu-22.04
2728
if: ${{ needs.check-changes.outputs.backend == 'true' }}
28-
runs-on: ubuntu-latest
29+
strategy:
30+
matrix:
31+
services:
32+
[
33+
{ directory: ./source/backend/api, solution: "Pims.sln" },
34+
{ directory: ./source/backend/proxy, solution: "Proxy.sln" },
35+
{
36+
directory: ./source/backend/scheduler,
37+
solution: "Scheduler.sln",
38+
},
39+
]
2940
env:
30-
working-directory: ./source/backend
41+
working-directory: ${{ matrix.services.directory }}
42+
solution-name: ${{ matrix.services.solution }}
3143
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
GIT_BRANCH: "${{github.ref}}"
44+
GIT_BRANCH: "${{ github.ref }}"
3345

3446
steps:
3547
- uses: actions/checkout@v4
@@ -45,19 +57,20 @@ jobs:
4557
dotnet-version: "8.0.x"
4658

4759
- name: Install dependencies
48-
run: dotnet restore
60+
run: dotnet restore ${{env.solution-name}}
4961
working-directory: ${{env.working-directory}}
5062

51-
- name: Install coverlet for code coverage
52-
run: dotnet tool install -g coverlet.console --version 1.7.2
63+
- name: Build
64+
run: dotnet build ${{env.solution-name}} --configuration Release --no-restore
5365
working-directory: ${{env.working-directory}}
5466

55-
- name: Build
56-
run: dotnet build --configuration Release --no-restore
67+
- name: Install coverlet for code coverage
68+
run: dotnet tool install -g coverlet.console --version 1.7.2
5769
working-directory: ${{env.working-directory}}
5870

5971
- name: Test
60-
run: dotnet test --no-restore --verbosity normal
72+
if: ${{ env.solution-name == 'Pims.sln' }}
73+
run: dotnet test Pims.sln --no-restore --verbosity normal
6174
working-directory: ${{env.working-directory}}
6275

6376
# For future reference, if we have N test projects the flow of events would be:
@@ -84,46 +97,54 @@ jobs:
8497
#
8598
# The final `coverage.opencover.xml` is the one we want
8699
- name: Generate code coverage
87-
working-directory: ${{env.working-directory}}/tests/unit
100+
if: ${{ env.solution-name == 'Pims.sln' }}
101+
working-directory: ${{env.working-directory}}/../tests/unit
88102
run: |
103+
pwd
89104
mkdir -p TestResults
90105
rm -rf api/TestResults
91106
rm -rf dal/TestResults
92107
rm -rf mockdal/TestResults
93108
cd api
94-
dotnet test --collect:"XPlat Code Coverage" --settings coverlet.runsettings --no-restore
109+
dotnet test --collect:"XPlat Code Coverage" --settings coverlet.runsettings --no-restore > out.txt
110+
ls
111+
cat out.txt
95112
mv TestResults/*/* ../TestResults/
96113
cd ..
97114
cd dal
98115
dotnet test --collect:"XPlat Code Coverage" --settings coverlet.runsettings --no-restore
116+
ls
99117
mv TestResults/*/* ../TestResults/
100118
cd ..
101119
cd mockdal
102120
dotnet test --collect:"XPlat Code Coverage" --settings coverlet.runsettings --no-restore
121+
ls
103122
mv TestResults/*/* ../TestResults/
104123
cd ..
105124
head TestResults/coverage.opencover.xml
106125
107126
- name: Save PR number and scan results
127+
if: ${{ env.solution-name == 'Pims.sln' }}
108128
run: |
109129
mkdir -p ./pr
110130
echo ${{ github.event.pull_request.number }} > ./pr/NR
111-
cp ${{env.working-directory}}/tests/unit/TestResults/coverage.opencover.xml ./pr
131+
cp ${{env.working-directory}}/../tests/unit/TestResults/coverage.opencover.xml ./pr
112132
113133
- uses: actions/upload-artifact@v4
134+
if: ${{ env.solution-name == 'Pims.sln' }}
114135
with:
115136
name: pr-codecov
116137
path: pr/
117138

118139
- name: SonarScanner for .NET 8 with pull request decoration support
119140
id: scan
120141
uses: highbyte/[email protected]
121-
if: ${{ github.event_name == 'push' }}
142+
if: ${{ github.event_name == 'push' && env.solution-name == 'Pims.sln' }}
122143
env:
123144
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
124145
with:
125-
dotnetBuildArguments: ${{env.working-directory}}
126-
dotnetTestArguments: ${{env.working-directory}} --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
146+
dotnetBuildArguments: ${{env.working-directory}}/${{ env.solution-name }}
147+
dotnetTestArguments: ${{env.working-directory}}/${{ env.solution-name }} --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
127148
# Optional extra command arguments the the SonarScanner 'begin' command
128149
sonarBeginArguments: /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx" -d:sonar.qualitygate.wait=true
129150
# The key of the SonarQube project
@@ -132,7 +153,14 @@ jobs:
132153
sonarProjectName: PIMS-API
133154
# The SonarQube server URL. For SonarCloud, skip this setting.
134155
sonarHostname: ${{secrets.SONAR_URL}}
135-
156+
post-build:
157+
needs: build-backend
158+
runs-on: ubuntu-22.04
159+
env:
160+
working-directory: ./source/backend
161+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
162+
GIT_BRANCH: "${{github.ref}}"
163+
steps:
136164
# Send notifications only if MS_TEAMS_NOTIFY_URL secret has been set
137165
- name: Failure notification to Teams Channel
138166
env:

.github/workflows/app-logging.yml

+42-45
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@ on:
66
pull_request:
77
branches: [master, test, dev]
88

9-
109
jobs:
11-
1210
build:
13-
1411
name: build-logging
1512
if: github.event.ref == 'refs/heads/master' || github.event.ref == 'refs/heads/test' || github.event.ref == 'refs/heads/dev'
16-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-22.04
1714
env:
1815
SLEEP_TIME: 60
1916
STORAGE_TYPE: Amazon_S3
@@ -32,44 +29,44 @@ jobs:
3229
working-directory: ./openshift/4.0/templates/Logging
3330

3431
steps:
35-
- uses: actions/checkout@v4
36-
- name: Set ENV variable
37-
run: |
38-
if [[ ${{github.event.ref}} == 'refs/heads/test' ]]; then
39-
echo "FRONTEND_APP_NAME=pims-app-test" >> $GITHUB_ENV
40-
echo "API_NAME=pims-api-test" >> $GITHUB_ENV
41-
elif [[ ${{github.event.ref}} == 'refs/heads/master' ]]; then
42-
echo "FRONTEND_APP_NAME=pims-app-uat" >> $GITHUB_ENV
43-
echo "API_NAME=pims-api-uat" >> $GITHUB_ENV
44-
echo "PROJECT_NAMESPACE=3cd915-test" >> $GITHUB_ENV
45-
else
46-
echo "FRONTEND_APP_NAME=pims-app" >> $GITHUB_ENV
47-
echo "API_NAME=pims-api" >> $GITHUB_ENV
48-
fi
49-
- name: Build the pims-logging docker-compose stack
50-
run: docker-compose -f docker-compose.yml up -d
51-
working-directory: ${{env.working-directory}}
52-
- name: Sleep for 180 seconds
53-
uses: jakejarvis/wait-action@master
54-
with:
55-
time: '180s'
56-
- name: Check Extracted Logs
57-
run: |
58-
docker cp pims-logging:/logging/. .
59-
exitcode=$(docker inspect pims-logging --format='{{.State.ExitCode}}')
60-
if [[ "$(ls -A pims* 2>/dev/null | wc -l)" != "0" ]]; then
61-
ls -A pims* && rm -f pims*
62-
elif [[ $exitcode == 0 ]]; then
63-
echo "Info: No log captured between sleep time"
64-
else
65-
echo "There's an error capturing pims logs" && exit 1
66-
fi
67-
- name: Check running containers
68-
run: docker ps -a
69-
- name: Check pims-logging logs
70-
if: always()
71-
run: docker logs pims-logging
72-
- name: Stop containers
73-
if: always()
74-
run: docker-compose -f "docker-compose.yml" down
75-
working-directory: ${{env.working-directory}}
32+
- uses: actions/checkout@v4
33+
- name: Set ENV variable
34+
run: |
35+
if [[ ${{github.event.ref}} == 'refs/heads/test' ]]; then
36+
echo "FRONTEND_APP_NAME=pims-app-test" >> $GITHUB_ENV
37+
echo "API_NAME=pims-api-test" >> $GITHUB_ENV
38+
elif [[ ${{github.event.ref}} == 'refs/heads/master' ]]; then
39+
echo "FRONTEND_APP_NAME=pims-app-uat" >> $GITHUB_ENV
40+
echo "API_NAME=pims-api-uat" >> $GITHUB_ENV
41+
echo "PROJECT_NAMESPACE=3cd915-test" >> $GITHUB_ENV
42+
else
43+
echo "FRONTEND_APP_NAME=pims-app" >> $GITHUB_ENV
44+
echo "API_NAME=pims-api" >> $GITHUB_ENV
45+
fi
46+
- name: Build the pims-logging docker-compose stack
47+
run: docker-compose -f docker-compose.yml up -d
48+
working-directory: ${{env.working-directory}}
49+
- name: Sleep for 180 seconds
50+
uses: jakejarvis/wait-action@master
51+
with:
52+
time: "180s"
53+
- name: Check Extracted Logs
54+
run: |
55+
docker cp pims-logging:/logging/. .
56+
exitcode=$(docker inspect pims-logging --format='{{.State.ExitCode}}')
57+
if [[ "$(ls -A pims* 2>/dev/null | wc -l)" != "0" ]]; then
58+
ls -A pims* && rm -f pims*
59+
elif [[ $exitcode == 0 ]]; then
60+
echo "Info: No log captured between sleep time"
61+
else
62+
echo "There's an error capturing pims logs" && exit 1
63+
fi
64+
- name: Check running containers
65+
run: docker ps -a
66+
- name: Check pims-logging logs
67+
if: always()
68+
run: docker logs pims-logging
69+
- name: Stop containers
70+
if: always()
71+
run: docker-compose -f "docker-compose.yml" down
72+
working-directory: ${{env.working-directory}}

.github/workflows/app-react.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
# JOB to run change detection
1111
check-changes:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-22.04
1313
# Set job outputs to values from filter step
1414
outputs:
1515
frontend: ${{ steps.filter.outputs.frontend }}
@@ -25,7 +25,7 @@ jobs:
2525
build-frontend:
2626
needs: check-changes
2727
if: ${{ needs.check-changes.outputs.frontend == 'true' }}
28-
runs-on: ubuntu-latest
28+
runs-on: ubuntu-22.04
2929
env:
3030
CI: true
3131
working-directory: ./source/frontend

0 commit comments

Comments
 (0)