Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
8 changes: 5 additions & 3 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 @@ -25,7 +27,7 @@ runs:
SFDX_AUTH_JWT_INSTANCE_URL: https://login.salesforce.com
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: quantic-playwright-env
name: quantic-playwright-env-lws-${{ inputs.lws-status }}
path: packages/quantic/.env
include-hidden-files: true
retention-days: 1
Expand Down
5 changes: 3 additions & 2 deletions .github/actions/playwright-quantic/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ runs:
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: quantic-playwright-env
path: packages/quantic
pattern: quantic-playwright-env-*
path: packages/quantic/.env
merge-multiple: true
- name: Run Playwright Tests
run: npx playwright test --shard=${{ inputs.shardIndex }}/${{ inputs.shardTotal }}
shell: bash
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 @@ -6,15 +6,16 @@ runs:
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: quantic-playwright-env
path: packages/quantic
pattern: quantic-playwright-env-*
path: packages/quantic/.env
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
4 changes: 4 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 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
Loading