Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/actions/e2e-quantic-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ inputs:
jwtkey:
description: The SFDX JWT key contents
required: true
lws-status:
description: 'Set to "enabled" to deploy the LWS enabled community, and "disabled to deploy the LWS disabled community'
required: true
runs:
using: composite
steps:
- run: |
echo "${{ inputs.jwtkey }}" > server.key
npx --no-install ts-node scripts/build/deploy-community.ts --ci --scratch-org-def-path=./config/lws-disabled-scratch-def.json
npx --no-install ts-node scripts/build/deploy-community.ts --ci --scratch-org-def-path=./config/lws-enabled-scratch-def.json
npx --no-install ts-node scripts/build/deploy-community.ts --ci --scratch-org-def-path=./config/lws-${{ inputs.lws-status }}-scratch-def.json
rm server.key
shell: bash
working-directory: ./packages/quantic
Expand All @@ -23,7 +25,10 @@ runs:
SFDX_AUTH_JWT_KEY_FILE: server.key
SFDX_AUTH_JWT_USERNAME: [email protected]
SFDX_AUTH_JWT_INSTANCE_URL: https://login.salesforce.com
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: quantic-playwright-env-lws-${{ inputs.lws-status }}
path: packages/quantic/.env
key: quantic-playwright-env-${{ github.sha }}
include-hidden-files: true
retention-days: 1
if-no-files-found: error
9 changes: 4 additions & 5 deletions .github/actions/playwright-quantic/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ inputs:
runs:
using: composite
steps:
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
pattern: quantic-playwright-env-*
path: packages/quantic/.env
key: quantic-playwright-env-${{ github.sha }}
merge-multiple: true
- name: Run Playwright Tests
run: |
npx playwright install --with-deps
npx playwright test --shard=${{ inputs.shardIndex }}/${{ inputs.shardTotal }}
run: npx playwright test --shard=${{ inputs.shardIndex }}/${{ inputs.shardTotal }}
shell: bash
working-directory: ./packages/quantic
- name: Upload blob report to GitHub Actions Artifacts
Expand Down
9 changes: 5 additions & 4 deletions .github/actions/post-scratch-org-links-on-pr/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ description: Publish Scratch Org Links as comments in a given PR
runs:
using: composite
steps:
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
pattern: quantic-playwright-env-*
path: packages/quantic/.env
key: quantic-playwright-env-${{ github.sha }}
merge-multiple: true

- name: Read Org URLs from .env
id: read-env
shell: bash
run: |
LWS_ENABLED_URL=$(grep 'Quantic__LWS_enabled_URL' packages/quantic/.env | cut -d '=' -f2-)
LWS_DISABLED_URL=$(grep 'Quantic__LWS_disabled_URL' packages/quantic/.env | cut -d '=' -f2-)
LWS_ENABLED_URL=$(grep 'Quantic__LWS_enabled_URL' packages/quantic/.env/Quantic__LWS_enabled.env | cut -d '=' -f2-)
LWS_DISABLED_URL=$(grep 'Quantic__LWS_disabled_URL' packages/quantic/.env/Quantic__LWS_disabled.env | cut -d '=' -f2-)
echo "lws_enabled_url=$LWS_ENABLED_URL" >> $GITHUB_OUTPUT
echo "lws_disabled_url=$LWS_DISABLED_URL" >> $GITHUB_OUTPUT

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/e2e-quantic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
e2e-quantic-setup:
name: 'Setup e2e tests on Quantic'
runs-on: ubuntu-latest
strategy:
matrix:
lws-status: ['enabled', 'disabled']
steps:
- name: Harden Runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
Expand All @@ -22,6 +25,7 @@ jobs:
with:
clientid: ${{ secrets.SFDX_AUTH_CLIENT_ID }}
jwtkey: ${{ secrets.SFDX_AUTH_JWT_KEY }}
lws-status: ${{ matrix.lws-status }}
post-scratch-org-links-to-pr:
name: 'Post Scratch Org Links to PR'
needs: e2e-quantic-setup
Expand All @@ -40,6 +44,9 @@ jobs:
name: 'Run Playwright e2e tests on Quantic'
needs: e2e-quantic-setup
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.54.1-noble
options: --user 1001
strategy:
fail-fast: false
matrix:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/setup-quantic-examples-community.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ jobs:

- name: Read .env file and print Community URL
run: |
source packages/quantic/.env
source packages/quantic/.env/Quantic__LWS_enabled.env
source packages/quantic/.env/Quantic__LWS_disabled.env
echo "The Quantic Examples Community URL (LWS enabled) is $Quantic__LWS_enabled_URL"
echo "The Quantic Examples Community URL (LWS disabled) is $Quantic__LWS_disabled_URL"
echo "### :rocket:Access Quantic Examples Community (LWS enabled) here --> $Quantic__LWS_enabled_URL" >> $GITHUB_STEP_SUMMARY
Expand Down
3 changes: 2 additions & 1 deletion packages/quantic/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {defineConfig, devices} from '@playwright/test';
*/
import dotenv from 'dotenv';
import path from 'path';
dotenv.config({path: path.resolve(__dirname, '.env')});
dotenv.config({path: path.resolve(__dirname, '.env/Quantic__LWS_enabled.env')});
dotenv.config({path: path.resolve(__dirname, '.env/Quantic__LWS_disabled.env')});

/**
* See https://playwright.dev/docs/test-configuration.
Expand Down
3 changes: 2 additions & 1 deletion packages/quantic/scripts/build/deploy-community.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ interface Options {
function updateEnvFile(filePath, newVariables) {
try {
if (!fs.existsSync(filePath)) {
fs.mkdirSync(path.dirname(filePath), {recursive: true});
fs.writeFileSync(filePath, '', 'utf8');
}

Expand Down Expand Up @@ -289,7 +290,7 @@ async function publishCommunity(
}

async function setCommunityBaseUrlAsEnvVariable(log, communityUrl, orgName) {
const pathSegments = [__dirname, '..', '..', '.env'];
const pathSegments = [__dirname, '..', '..', '.env', `${orgName}.env`];
const envFilePath = path.join(...pathSegments);
const newEnvVariables = {
[`${orgName}_URL`]: communityUrl,
Expand Down