Skip to content

Commit

Permalink
Merge pull request #1719 from aziontech/dev
Browse files Browse the repository at this point in the history
DEPLOY 2024-09-17
  • Loading branch information
william-tome authored Sep 17, 2024
2 parents 8466805 + bfd4505 commit 513b8f5
Show file tree
Hide file tree
Showing 70 changed files with 3,704 additions and 552 deletions.
122 changes: 0 additions & 122 deletions .github/workflows/dev-e2e-tests.yml

This file was deleted.

133 changes: 129 additions & 4 deletions .github/workflows/pre-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,149 @@ jobs:
run: yarn test:unit:coverage

- name: Upload coverage reports
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage_unit_report
path: |
coverage/unit/lcov.info
coverage/unit/sonar-report.xml
retention-days: 1

run-dev-e2e-tests:
name: Run Dev E2E Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
group: [2, 3, 4, 5, 6, 7]
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- name: Run Cypress Tests
uses: cypress-io/github-action@v6
env:
DEV_CYPRESS_EMAIL: ${{ secrets.DEV_CYPRESS_EMAIL }}
DEV_CYPRESS_PASSWORD: ${{ secrets.DEV_CYPRESS_PASSWORD }}
with:
build: yarn build
start: yarn dev --logLevel=warn
browser: chrome
wait-on: 'http://localhost:5173/'
wait-on-timeout: 120
env: grepTags=@dev${{ matrix.group }}+-@xfail

- name: Generate Specs JSON
run: yarn generate-specs-json

- name: Validate Specs Tags
run: node ./scripts/check_tags.js specs.json

- name: Move Coverage Files
run: mv .nyc_output/out.json .nyc_output/out_${{ matrix.group }}.json

- name: Upload Cypress Screenshots
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: cypress_screenshots_${{ matrix.group }}
path: cypress/screenshots
retention-days: 4

- name: Upload Cypress Videos
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: cypress_videos_${{ matrix.group }}
path: cypress/videos
retention-days: 1

- name: Upload Coverage Files
uses: actions/upload-artifact@v4
with:
name: coverage_report_${{ matrix.group }}
path: .nyc_output/*
retention-days: 1
include-hidden-files: true

download_and_merge:
name: Download and Merge Coverage Reports
needs: run-dev-e2e-tests
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install Dependencies
run: npm install --global nyc

- name: Download Coverage Artifacts
uses: actions/download-artifact@v4
with:
path: coverage_report
pattern: coverage_report_*
merge-multiple: true

- name: Merge Coverage Reports
run: npx nyc merge ./coverage_report .nyc_output/out.json

- name: Generate Text Coverage Report
run: npx nyc report --reporter=text-summary

- name: Generate HTML Coverage Report
run: npx nyc report --reporter=html --report-dir=./coverage/e2e

- name: Generate LCOV Report
run: npx nyc report --reporter=lcovonly --report-dir=./coverage/e2e

- name: Check E2E Test Coverage
if: ${{ always() }}
run: node ./scripts/check_coverage.js ./coverage/e2e/lcov.info 20

- name: Compress Coverage Reports
if: ${{ always() }}
run: zip -r coverage.zip coverage

- name: Upload Coverage Report Artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: coverage_e2e_report
path: coverage.zip
retention-days: 7

sonarcloud:
needs: [run-tests]
needs: [run-tests, download_and_merge]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v3

- uses: actions/download-artifact@v4
with:
name: coverage_unit_report

- uses: actions/download-artifact@v4
with:
name: coverage_unit_report
name: coverage_e2e_report

- name: Extract E2E Coverage Report
run: |
unzip coverage.zip -d coverage_e2e
pwd
find ./
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@v2.3.0
env:
Expand Down
19 changes: 19 additions & 0 deletions azion.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,19 @@ const backRules = [
},
rewrite: '/aziontech/console-client-list/main/clids.json'
}
},
{
name: 'Route Send Feedback',
description: 'this route will send user feedback to jira',
match: '^/api/webhook/console_feedback',
behavior: {
forwardCookies: true,
setOrigin: {
name: 'origin-console-feedback',
type: 'single_origin'
},
rewrite: '/webhook/console_feedback'
}
}
]

Expand Down Expand Up @@ -303,6 +316,12 @@ const AzionConfig = {
hostHeader: `raw.githubusercontent.com`,
addresses: [`raw.githubusercontent.com`]
},
{
name: 'origin-console-feedback',
type: 'single_origin',
hostHeader: `automate.azion.net`,
addresses: [`automate.azion.net`]
},
],
rules: {
request: [...commonRules, ...frontRules, ...backRules],
Expand Down
12 changes: 11 additions & 1 deletion azion/production/azion.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
"origin-id": 142751,
"origin-key": "4c361d2f-dbb5-42c0-a6b6-28b0e6e50d91",
"name": "console_kit_31-07-2024_single"
},
{
"origin-id": 153663,
"origin-key": "6ec17c87-d2fb-4c28-a3b7-588b1ae61bf2",
"name": "origin-github-allowed-accounts"
}
],
"rules-engine": {
Expand Down Expand Up @@ -142,6 +147,11 @@
"id": 269763,
"name": "Secure Headers",
"phase": "response"
},
{
"id": 296352,
"name": "Route List Client Ids to Github",
"phase": "request"
}
]
},
Expand All @@ -159,4 +169,4 @@
"name": "Cities - Cache"
}
]
}
}
10 changes: 10 additions & 0 deletions azion/stage/azion.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
"origin-id": 153113,
"origin-key": "ab771dc5-8ee9-4f9f-bb5d-3fa6fe9483c5",
"name": "origin-github-allowed-accounts"
},
{
"origin-id": 153761,
"origin-key": "f1f976fb-0558-4592-a930-dcad70ab2e7c",
"name": "origin-console-feedback"
}
],
"rules-engine": {
Expand Down Expand Up @@ -152,6 +157,11 @@
"id": 294965,
"name": "Route List Client Ids to Github",
"phase": "request"
},
{
"id": 296641,
"name": "Route Send Feedback",
"phase": "request"
}
]
},
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "azion-platform-kit",
"version": "1.21.0",
"private": true,
"name": "azion-console-kit",
"version": "1.22.0",
"private": false,
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/aziontech/azion-platform-kit.git"
"url": "https://github.com/aziontech/azion-console-kit.git"
},
"scripts": {
"dev": "vite",
Expand Down Expand Up @@ -34,7 +34,6 @@
},
"dependencies": {
"@analytics/segment": "^2.1.0",
"@feedback-fish/vue": "^1.0.1",
"@guolao/vue-monaco-editor": "^1.3.0",
"@stripe/stripe-js": "^4.1.0",
"@vee-validate/yup": "^4.11.1",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sonar.log.level=INFO
sonar.language=js

# Specifies the code coverage report path for JavaScript
sonar.javascript.lcov.reportPaths=lcov.info
sonar.javascript.lcov.reportPaths=lcov.info,coverage_e2e/coverage/e2e/lcov.info
#sonar.testExecutionReportPaths=sonar-report.xml

# Defines the source code and test directories
Expand Down
Loading

0 comments on commit 513b8f5

Please sign in to comment.