-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Drew MORGAN
authored and
Drew MORGAN
committed
Feb 27, 2025
1 parent
097b6a5
commit 602b97c
Showing
28 changed files
with
2,140 additions
and
2,140 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 |
---|---|---|
@@ -1,131 +1,131 @@ | ||
name: QA Visualisation Workflow | ||
|
||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: Which environment to run the QA visualiser on | ||
required: true | ||
type: choice | ||
options: ['Dev', 'Tst', 'Staging', 'Production'] | ||
default: 'Staging' | ||
recommendations: | ||
type: boolean | ||
description: Include recommendations | ||
required: false | ||
default: false | ||
workflow_call: | ||
inputs: | ||
environment: | ||
type: string | ||
required: true | ||
|
||
env: | ||
DOTNET_VERSION: ${{ vars.DOTNET_VERSION }} | ||
|
||
jobs: | ||
generate_images: | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
name: Generate visualisations for ${{ inputs.environment }} | ||
env: | ||
az_keyvault_name: ${{ secrets.AZ_ENVIRONMENT }}${{ secrets.DFE_PROJECT_NAME }}-kv | ||
az_resource_group_name: ${{ secrets.AZ_ENVIRONMENT }}${{ secrets.DFE_PROJECT_NAME }} | ||
az_sql_database_server_name: ${{ secrets.AZ_ENVIRONMENT }}${{ secrets.DFE_PROJECT_NAME }} | ||
az_keyvault_plantech_api_key_name: api--authentication--keyvalue | ||
SQL_IP_NAME: qa-viz | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login with AZ | ||
uses: ./.github/actions/azure-login | ||
with: | ||
az_tenant_id: ${{ secrets.AZ_TENANT_ID }} | ||
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }} | ||
az_client_id: ${{ secrets.AZ_CLIENT_ID }} | ||
az_client_secret: ${{ secrets.AZ_CLIENT_SECRET }} | ||
|
||
- name: Build web app | ||
uses: ./.github/actions/build-dotnet-app | ||
with: | ||
dotnet_version: ${{ env.DOTNET_VERSION }} | ||
solution_filename: plan-technology-for-your-school.sln | ||
|
||
- name: Get workflow IP address | ||
id: whats-my-ip | ||
uses: ./.github/actions/whats-my-ip-address | ||
|
||
- name: Add Azure firewall rules | ||
uses: ./.github/actions/azure-ip-whitelist | ||
with: | ||
ip_address: ${{ steps.whats-my-ip.outputs.ip }} | ||
verb: "add" | ||
az_keyvault_name: ${{ env.az_keyvault_name }} | ||
az_ip_name: ${{ env.SQL_IP_NAME }} | ||
az_resource_group: ${{ env.az_resource_group_name}} | ||
az_sql_database_server_name: ${{ env.az_sql_database_server_name }} | ||
|
||
- name: Run project | ||
shell: bash | ||
working-directory: ./build | ||
run: | | ||
export ASPNETCORE_ENVIRONMENT=E2E | ||
export KeyVaultName=${{ env.az_keyvault_name }} | ||
export Kestrel__Endpoints__Https__Url=https://*:8081 | ||
export DfeSignIn__FrontDoorUrl=https://localhost:8081 | ||
export GTM__Id=gtm_id | ||
export GTM__SiteVerificationId=testing_site_verification_id | ||
dotnet ./Dfe.PlanTech.Web.dll --DfeSignIn:FrontDoorUrl=https://localhost:8081 & | ||
- name: Export dev certificate | ||
run: dotnet dev-certs https --export-path contentful/qa-visualiser/localhost.crt --format PEM | ||
|
||
- name: Install Graphviz | ||
run: sudo apt-get install graphviz -y | ||
|
||
- name: Get api key | ||
id: get-plantech-api-key | ||
uses: ./.github/actions/azure-get-keyvault-secret | ||
with: | ||
az_keyvault_name: ${{ env.az_keyvault_name }} | ||
az_keyvault_secret_name: ${{ env.az_keyvault_plantech_api_key_name }} | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
|
||
- name: Set up Python | ||
working-directory: ./contentful/qa-visualiser | ||
run: uv python install | ||
|
||
- name: Install requirements | ||
working-directory: ./contentful/qa-visualiser | ||
run: uv sync | ||
|
||
- name: Run visualisation script | ||
working-directory: ./contentful/qa-visualiser | ||
run: uv run main.py | ||
env: | ||
PLANTECH_API_URL: https://localhost:8081/api/cms | ||
PLANTECH_API_KEY: ${{ steps.get-plantech-api-key.outputs.secret_value }} | ||
REQUESTS_CA_BUNDLE: localhost.crt | ||
DISPLAY_RECOMMENDATIONS: ${{ inputs.recommendations }} | ||
|
||
- name: Remove Azure firewall rules | ||
uses: ./.github/actions/azure-ip-whitelist | ||
with: | ||
ip_address: ${{ steps.whats-my-ip.outputs.ip }} | ||
verb: "remove" | ||
az_keyvault_name: ${{ env.az_keyvault_name }} | ||
az_ip_name: ${{ env.SQL_IP_NAME }} | ||
az_resource_group: ${{ env.az_resource_group_name}} | ||
az_sql_database_server_name: ${{ env.az_sql_database_server_name }} | ||
|
||
- name: Upload image | ||
id: artifact-upload-step | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: qa-visualisations | ||
path: ./contentful/qa-visualiser/visualisations | ||
name: QA Visualisation Workflow | ||
|
||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: Which environment to run the QA visualiser on | ||
required: true | ||
type: choice | ||
options: ['Dev', 'Tst', 'Staging', 'Production'] | ||
default: 'Staging' | ||
recommendations: | ||
type: boolean | ||
description: Include recommendations | ||
required: false | ||
default: false | ||
workflow_call: | ||
inputs: | ||
environment: | ||
type: string | ||
required: true | ||
|
||
env: | ||
DOTNET_VERSION: ${{ vars.DOTNET_VERSION }} | ||
|
||
jobs: | ||
generate_images: | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
name: Generate visualisations for ${{ inputs.environment }} | ||
env: | ||
az_keyvault_name: ${{ secrets.AZ_ENVIRONMENT }}${{ secrets.DFE_PROJECT_NAME }}-kv | ||
az_resource_group_name: ${{ secrets.AZ_ENVIRONMENT }}${{ secrets.DFE_PROJECT_NAME }} | ||
az_sql_database_server_name: ${{ secrets.AZ_ENVIRONMENT }}${{ secrets.DFE_PROJECT_NAME }} | ||
az_keyvault_plantech_api_key_name: api--authentication--keyvalue | ||
SQL_IP_NAME: qa-viz | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login with AZ | ||
uses: ./.github/actions/azure-login | ||
with: | ||
az_tenant_id: ${{ secrets.AZ_TENANT_ID }} | ||
az_subscription_id: ${{ secrets.AZ_SUBSCRIPTION_ID }} | ||
az_client_id: ${{ secrets.AZ_CLIENT_ID }} | ||
az_client_secret: ${{ secrets.AZ_CLIENT_SECRET }} | ||
|
||
- name: Build web app | ||
uses: ./.github/actions/build-dotnet-app | ||
with: | ||
dotnet_version: ${{ env.DOTNET_VERSION }} | ||
solution_filename: plan-technology-for-your-school.sln | ||
|
||
- name: Get workflow IP address | ||
id: whats-my-ip | ||
uses: ./.github/actions/whats-my-ip-address | ||
|
||
- name: Add Azure firewall rules | ||
uses: ./.github/actions/azure-ip-whitelist | ||
with: | ||
ip_address: ${{ steps.whats-my-ip.outputs.ip }} | ||
verb: "add" | ||
az_keyvault_name: ${{ env.az_keyvault_name }} | ||
az_ip_name: ${{ env.SQL_IP_NAME }} | ||
az_resource_group: ${{ env.az_resource_group_name}} | ||
az_sql_database_server_name: ${{ env.az_sql_database_server_name }} | ||
|
||
- name: Run project | ||
shell: bash | ||
working-directory: ./build | ||
run: | | ||
export ASPNETCORE_ENVIRONMENT=E2E | ||
export KeyVaultName=${{ env.az_keyvault_name }} | ||
export Kestrel__Endpoints__Https__Url=https://*:8081 | ||
export DfeSignIn__FrontDoorUrl=https://localhost:8081 | ||
export GTM__Id=gtm_id | ||
export GTM__SiteVerificationId=testing_site_verification_id | ||
dotnet ./Dfe.PlanTech.Web.dll --DfeSignIn:FrontDoorUrl=https://localhost:8081 & | ||
- name: Export dev certificate | ||
run: dotnet dev-certs https --export-path contentful/qa-visualiser/localhost.crt --format PEM | ||
|
||
- name: Install Graphviz | ||
run: sudo apt-get install graphviz -y | ||
|
||
- name: Get api key | ||
id: get-plantech-api-key | ||
uses: ./.github/actions/azure-get-keyvault-secret | ||
with: | ||
az_keyvault_name: ${{ env.az_keyvault_name }} | ||
az_keyvault_secret_name: ${{ env.az_keyvault_plantech_api_key_name }} | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
|
||
- name: Set up Python | ||
working-directory: ./contentful/qa-visualiser | ||
run: uv python install | ||
|
||
- name: Install requirements | ||
working-directory: ./contentful/qa-visualiser | ||
run: uv sync | ||
|
||
- name: Run visualisation script | ||
working-directory: ./contentful/qa-visualiser | ||
run: uv run main.py | ||
env: | ||
PLANTECH_API_URL: https://localhost:8081/api/cms | ||
PLANTECH_API_KEY: ${{ steps.get-plantech-api-key.outputs.secret_value }} | ||
REQUESTS_CA_BUNDLE: localhost.crt | ||
DISPLAY_RECOMMENDATIONS: ${{ inputs.recommendations }} | ||
|
||
- name: Remove Azure firewall rules | ||
uses: ./.github/actions/azure-ip-whitelist | ||
with: | ||
ip_address: ${{ steps.whats-my-ip.outputs.ip }} | ||
verb: "remove" | ||
az_keyvault_name: ${{ env.az_keyvault_name }} | ||
az_ip_name: ${{ env.SQL_IP_NAME }} | ||
az_resource_group: ${{ env.az_resource_group_name}} | ||
az_sql_database_server_name: ${{ env.az_sql_database_server_name }} | ||
|
||
- name: Upload image | ||
id: artifact-upload-step | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: qa-visualisations | ||
path: ./contentful/qa-visualiser/visualisations |
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 |
---|---|---|
@@ -1,23 +1,23 @@ | ||
MANAGEMENT_TOKEN="Contentful management token" | ||
DELIVERY_TOKEN="Contentful delivery token for environment" | ||
USE_PREVIEW="true" | ||
SPACE_ID="Contentful space id" | ||
ENVIRONMENT="master" | ||
|
||
#If true, will save the exported data from Contentful to a file. | ||
SAVE_FILE="false" | ||
|
||
#Directory to save the processed data to | ||
OUTPUT_FILE_DIR="./output/" | ||
|
||
#If true, will save user journey path information for subtopics | ||
EXPORT_USER_JOURNEY_PATHS="true" | ||
|
||
#If true, will export ALL possible user journey paths per subtopic for the above | ||
EXPORT_ALL_PATHS="false" | ||
|
||
#If true, will generate and save test suites | ||
GENERATE_TEST_SUITES="true" | ||
|
||
#Where to post Content updates to | ||
MANAGEMENT_TOKEN="Contentful management token" | ||
DELIVERY_TOKEN="Contentful delivery token for environment" | ||
USE_PREVIEW="true" | ||
SPACE_ID="Contentful space id" | ||
ENVIRONMENT="master" | ||
|
||
#If true, will save the exported data from Contentful to a file. | ||
SAVE_FILE="false" | ||
|
||
#Directory to save the processed data to | ||
OUTPUT_FILE_DIR="./output/" | ||
|
||
#If true, will save user journey path information for subtopics | ||
EXPORT_USER_JOURNEY_PATHS="true" | ||
|
||
#If true, will export ALL possible user journey paths per subtopic for the above | ||
EXPORT_ALL_PATHS="false" | ||
|
||
#If true, will generate and save test suites | ||
GENERATE_TEST_SUITES="true" | ||
|
||
#Where to post Content updates to | ||
FUNCTION_APP_URL="https:#cool-function-app.com" |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
#Generated outputs | ||
contentful*.json | ||
content-errors*.md | ||
plan-tech-test-suite*.csv | ||
output/ | ||
inserted-groups.json | ||
csv-test.csv | ||
|
||
#Env variables | ||
.env | ||
#Generated outputs | ||
contentful*.json | ||
content-errors*.md | ||
plan-tech-test-suite*.csv | ||
output/ | ||
inserted-groups.json | ||
csv-test.csv | ||
|
||
#Env variables | ||
.env | ||
.env.* |
Oops, something went wrong.