Skip to content

Commit 755cee7

Browse files
authored
Merge pull request #1221 from bcgov/test
Create Latest Release
2 parents e6d37a3 + 5959497 commit 755cee7

File tree

39 files changed

+138
-3529
lines changed

39 files changed

+138
-3529
lines changed

.github/workflows/aps-cypress-e2e.yaml

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
workflow_dispatch: {}
55
push:
66
branches: ['test', 'cypress/*']
7+
pull_request:
8+
branches: ['dev']
79

810
env:
911
DASHBOARD_PROJECT_ID: ${{ secrets.CY_DASHBOARD_PRJ_ID }}
@@ -21,7 +23,7 @@ jobs:
2123
steps:
2224
- name: Build GWA API Image
2325
run: |
24-
git clone https://github.com/bcgov/gwa-api.git
26+
git clone https://github.com/bcgov/gwa-api.git --branch v1.0.40
2527
cd gwa-api/microservices/gatewayApi
2628
docker build -t gwa-api:e2e .
2729
@@ -47,60 +49,50 @@ jobs:
4749
4850
- name: Execute Tests & Clean Up
4951
run: |
52+
# Start following logs in the background with continuous output
53+
docker logs -f cypress-e2e 2>&1 &
54+
LOG_PID=$!
55+
5056
while true; do
5157
if [ "$(docker ps -aq -f status=exited -f name=cypress-e2e)" ]; then
58+
echo "Cypress tests completed."
5259
# cleanup
5360
docker compose down
5461
break
5562
else
56-
echo "Waiting for Cypress to Complete E2E Tests....."
57-
sleep 1m
63+
sleep 30s
5864
fi
5965
done
6066
6167
- name: Upload E2E Test Results HTML Report
68+
if: always()
6269
uses: actions/upload-artifact@v4
6370
with:
6471
name: test-results-html
6572
path: ${{ github.workspace }}/e2e/results/report
6673

6774
- name: Upload E2E Test Results JSON Report
75+
if: always()
6876
uses: actions/upload-artifact@v4
6977
with:
7078
name: test-results-json
7179
path: ${{ github.workspace }}/e2e/results/bcgov-aps-e2e-report.json
7280

7381
- name: Upload E2E Code Coverage Report
82+
if: always()
7483
uses: actions/upload-artifact@v4
7584
with:
7685
name: code-coverage
7786
path: ${{ github.workspace }}/e2e/coverage
7887

79-
- name: Instrument the code for coverage analysis
80-
run: |
81-
# Rewrite the paths as the coverage starts with '../app'!
82-
sed -e 's/..\/app/./g' ./e2e/coverage/lcov.info > lcov.info
83-
84-
#cd src
85-
#npm install --legacy-peer-deps
86-
#npx nyc instrument --compact=false . --in-place
87-
88-
- name: SonarCloud Scan
89-
uses: sonarsource/sonarcloud-github-action@master
88+
- name: Upload Astra scan results
89+
uses: actions/upload-artifact@v4
9090
with:
91-
args: >
92-
-Dsonar.organization=bcgov-oss
93-
-Dsonar.projectKey=aps-portal-e2e
94-
-Dsonar.host.url=https://sonarcloud.io
95-
-Dsonar.projectBaseDir=src
96-
-Dsonar.sources=.
97-
-Dsonar.exclusions=nextapp/**,mocks/**,test/**,tools/**,*.json,*.js
98-
-Dsonar.javascript.lcov.reportPaths=/github/workspace/lcov.info
99-
env:
100-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
102-
91+
name: astra-scan-results
92+
path: ${{ github.workspace }}/e2e/cypress/fixtures/state/scanResult.json
93+
10394
- name: Check for failed tests and create Issue
95+
if: always()
10496
env:
10597
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10698
run: |
@@ -122,6 +114,30 @@ jobs:
122114
exit 1
123115
fi
124116
117+
- name: Instrument the code for coverage analysis
118+
run: |
119+
# Rewrite the paths as the coverage starts with '../app'!
120+
sed -e 's/..\/app/./g' ./e2e/coverage/lcov.info > lcov.info
121+
122+
#cd src
123+
#npm install --legacy-peer-deps
124+
#npx nyc instrument --compact=false . --in-place
125+
126+
- name: SonarCloud Scan
127+
uses: sonarsource/sonarqube-scan-action@master
128+
with:
129+
args: >
130+
-Dsonar.organization=bcgov-oss
131+
-Dsonar.projectKey=aps-portal-e2e
132+
-Dsonar.host.url=https://sonarcloud.io
133+
-Dsonar.projectBaseDir=src
134+
-Dsonar.sources=.
135+
-Dsonar.exclusions=nextapp/**,mocks/**,test/**,tools/**,*.json,*.js
136+
-Dsonar.javascript.lcov.reportPaths=/github/workspace/lcov.info
137+
env:
138+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
139+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
140+
125141
- name: Set up Python 3.9
126142
if: failure()
127143
uses: actions/setup-python@v2

.github/workflows/ci-anchore-img-scan.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
uses: anchore/scan-action@main
1717
with:
1818
image: 'bcgov/api-services-portal:anchore-scan'
19-
acs-report-enable: true
2019
fail-build: false
20+
output-file: 'anchore-results.sarif'
2121
- name: Upload Anchore Scan Results
22-
uses: github/codeql-action/upload-sarif@v1
22+
uses: github/codeql-action/upload-sarif@v3
2323
with:
24-
sarif_file: results.sarif
24+
sarif_file: anchore-results.sarif

.github/workflows/ci-feat-sonar.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
docker compose down
4343
4444
- name: SonarCloud Scan
45-
uses: sonarsource/sonarcloud-github-action@master
45+
uses: sonarsource/sonarqube-scan-action@master
4646
with:
4747
args: >
4848
-Dsonar.organization=bcgov-oss

.github/workflows/ci-trivy-img-scan.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ jobs:
2424
template: '@/contrib/sarif.tpl'
2525
output: 'trivy-results.sarif'
2626
- name: Upload Trivy Scan Results
27-
uses: github/codeql-action/upload-sarif@v1
27+
uses: github/codeql-action/upload-sarif@v3
2828
with:
2929
sarif_file: 'trivy-results.sarif'

.github/workflows/jira.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [issues, issue_comment]
44
jobs:
55
sync-issues:
66
name: Sync issues to Jira
7-
runs-on: ubuntu-latest
7+
runs-on: ubuntu-22.04
88
steps:
99
- uses: ikethecoder/sync-issues-github-jira@dev
1010
with:

.github/workflows/pr-reminder.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: 'Send review reminders'
2+
on:
3+
schedule:
4+
- cron: '30 13 * * 1,2,3,4,5' # Scheduled to run at 5:30 AM PST, weekdays
5+
6+
jobs:
7+
remind:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Run PR reviewer reminder
11+
uses: bcgov/aps-devops/pr-reminder@dev
12+
with:
13+
token: ${{ secrets.GITHUB_TOKEN }}
14+
dry_run: "false"

.github/workflows/scripts/feeder-init/legal.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ entity: Legal
22
record:
33
id: "terms-of-use-for-api-gateway-1"
44
title: "Terms of Use for API Gateway"
5-
link: "https://www2.gov.bc.ca/gov/content/data/open-data/api-terms-of-use-for-ogl-information"
5+
link: "https://www2.gov.bc.ca/gov/content/data/policy-standards/open-data/api-terms-of-use-for-ogl-information"
66
document: terms-of-use
77
version: 1

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#FROM node:lts-alpine3.17
2-
FROM node:16.14.2-alpine3.15
2+
FROM node:22.12.0-alpine3.21
33

44
ARG APP_VERSION
55
ENV NEXT_PUBLIC_APP_VERSION=${APP_VERSION}

e2e/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ COPY e2e/*.yml /e2e
2222
COPY e2e/entrypoint.sh /tmp
2323
ADD e2e/cypress /e2e/cypress
2424

25-
RUN curl -v -L -O https://github.com/bcgov/gwa-cli/releases/download/v3.0.4/gwa_Linux_x86_64.tgz \
25+
RUN curl -v -L -O https://github.com/bcgov/gwa-cli/releases/download/v3.0.5/gwa_Linux_x86_64.tgz \
2626
&& tar -xzf gwa_Linux_x86_64.tgz \
2727
&& mv gwa /usr/local/bin/.
2828

e2e/cypress.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default defineConfig({
2626
'./cypress/tests/07-*/*.ts',
2727
'./cypress/tests/03-*/*.ts',
2828
'./cypress/tests/04-*/*.ts',
29-
'./cypress/tests/05-*/*.ts',
29+
// './cypress/tests/05-*/*.ts',
3030
'./cypress/tests/08-*/*.ts',
3131
'./cypress/tests/09-*/*.ts',
3232
'./cypress/tests/10-*/*.ts',

0 commit comments

Comments
 (0)