Skip to content

Commit

Permalink
ci: print deployment summary
Browse files Browse the repository at this point in the history
  • Loading branch information
adrians5j committed Nov 29, 2024
1 parent f1b3707 commit fef791e
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 61 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/pullRequestsCommandCypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# and run "github-actions-wac build" (or "ghawac build") to regenerate this file.
# For more information, run "github-actions-wac --help".
name: Pull Requests Command - Cypress
'on': issue_comment
"on": issue_comment
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
AWS_REGION: eu-central-1
jobs:
checkComment:
Expand All @@ -21,9 +21,9 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
command: cypress
reaction: 'true'
reaction: "true"
reaction-type: eyes
allow-edits: 'false'
allow-edits: "false"
permission-level: write
- name: Create comment
uses: peter-evans/create-or-update-comment@v2
Expand All @@ -35,7 +35,7 @@ jobs:
github.run_id }})). :sparkles:
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
YARN_ENABLE_IMMUTABLE_INSTALLS: false
validateWorkflows:
name: Validate workflows
Expand All @@ -51,7 +51,7 @@ jobs:
needs: checkComment
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
YARN_ENABLE_IMMUTABLE_INSTALLS: false
baseBranch:
needs: checkComment
Expand All @@ -72,7 +72,7 @@ jobs:
baseRefName -q .baseRefName)" >> $GITHUB_OUTPUT
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
YARN_ENABLE_IMMUTABLE_INSTALLS: false
constants:
needs: baseBranch
Expand All @@ -97,7 +97,7 @@ jobs:
vars.RANDOM_CACHE_KEY_SUFFIX }}" >> $GITHUB_OUTPUT
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
YARN_ENABLE_IMMUTABLE_INSTALLS: false
build:
name: Build
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
path: ${{ needs.baseBranch.outputs.base-branch }}/.webiny/cached-packages
key: ${{ needs.constants.outputs.run-cache-key }}
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
YARN_ENABLE_IMMUTABLE_INSTALLS: false
e2e-wby-cms-ddb-constants:
needs:
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
github.run_id }}_ddb" >> $GITHUB_OUTPUT
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
YARN_ENABLE_IMMUTABLE_INSTALLS: false
e2e-wby-cms-ddb-project-setup:
needs:
Expand All @@ -184,7 +184,7 @@ jobs:
cypress-config: ${{ steps.save-cypress-config.outputs.cypress-config }}
environment: next
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
YARN_ENABLE_IMMUTABLE_INSTALLS: false
CYPRESS_MAILOSAUR_API_KEY: ${{ secrets.CYPRESS_MAILOSAUR_API_KEY }}
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
Expand Down Expand Up @@ -285,25 +285,25 @@ jobs:
working-directory: new-webiny-project
run: yarn webiny deploy apps/website --env dev
- name: Deployment Summary
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
run: >-
node
.github/workflows/wac/utils/runNodeScripts/printDeploymentSummary.js
'../new-webiny-project' >> $GITHUB_STEP_SUMMARY
- name: Create Cypress config
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
- name: Create Cypress config
run: yarn setup-cypress --projectFolder ../new-webiny-project
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
- name: Save Cypress config
id: save-cypress-config
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
run: >-
echo "cypress-config=$(cat cypress-tests/cypress.config.ts | tr -d
'\t\n\r')" >> $GITHUB_OUTPUT
- name: Cypress - run installation wizard test
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
- name: Cypress - run installation wizard test
run: >-
yarn cy:run --browser chrome --spec
"cypress/e2e/adminInstallation/**/*.cy.js"
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -328,7 +328,7 @@ jobs:
}}
environment: next
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
YARN_ENABLE_IMMUTABLE_INSTALLS: false
CYPRESS_MAILOSAUR_API_KEY: ${{ secrets.CYPRESS_MAILOSAUR_API_KEY }}
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
Expand Down Expand Up @@ -404,7 +404,7 @@ jobs:
github.run_id }}_ddb-es" >> $GITHUB_OUTPUT
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
YARN_ENABLE_IMMUTABLE_INSTALLS: false
e2e-wby-cms-ddb-es-project-setup:
needs:
Expand All @@ -416,7 +416,7 @@ jobs:
cypress-config: ${{ steps.save-cypress-config.outputs.cypress-config }}
environment: next
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
YARN_ENABLE_IMMUTABLE_INSTALLS: false
CYPRESS_MAILOSAUR_API_KEY: ${{ secrets.CYPRESS_MAILOSAUR_API_KEY }}
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
Expand Down Expand Up @@ -520,25 +520,25 @@ jobs:
working-directory: new-webiny-project
run: yarn webiny deploy apps/website --env dev
- name: Deployment Summary
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
run: >-
node
.github/workflows/wac/utils/runNodeScripts/printDeploymentSummary.js
'../new-webiny-project' >> $GITHUB_STEP_SUMMARY
- name: Create Cypress config
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
- name: Create Cypress config
run: yarn setup-cypress --projectFolder ../new-webiny-project
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
- name: Save Cypress config
id: save-cypress-config
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
run: >-
echo "cypress-config=$(cat cypress-tests/cypress.config.ts | tr -d
'\t\n\r')" >> $GITHUB_OUTPUT
- name: Cypress - run installation wizard test
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
- name: Cypress - run installation wizard test
run: >-
yarn cy:run --browser chrome --spec
"cypress/e2e/adminInstallation/**/*.cy.js"
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -564,7 +564,7 @@ jobs:
}}
environment: next
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
YARN_ENABLE_IMMUTABLE_INSTALLS: false
CYPRESS_MAILOSAUR_API_KEY: ${{ secrets.CYPRESS_MAILOSAUR_API_KEY }}
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
Expand Down Expand Up @@ -644,7 +644,7 @@ jobs:
github.run_id }}_ddb-os" >> $GITHUB_OUTPUT
runs-on: ubuntu-latest
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
YARN_ENABLE_IMMUTABLE_INSTALLS: false
e2e-wby-cms-ddb-os-project-setup:
needs:
Expand All @@ -656,7 +656,7 @@ jobs:
cypress-config: ${{ steps.save-cypress-config.outputs.cypress-config }}
environment: next
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
YARN_ENABLE_IMMUTABLE_INSTALLS: false
CYPRESS_MAILOSAUR_API_KEY: ${{ secrets.CYPRESS_MAILOSAUR_API_KEY }}
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
Expand Down Expand Up @@ -760,25 +760,25 @@ jobs:
working-directory: new-webiny-project
run: yarn webiny deploy apps/website --env dev
- name: Deployment Summary
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
run: >-
node
.github/workflows/wac/utils/runNodeScripts/printDeploymentSummary.js
'../new-webiny-project' >> $GITHUB_STEP_SUMMARY
- name: Create Cypress config
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
- name: Create Cypress config
run: yarn setup-cypress --projectFolder ../new-webiny-project
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
- name: Save Cypress config
id: save-cypress-config
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
run: >-
echo "cypress-config=$(cat cypress-tests/cypress.config.ts | tr -d
'\t\n\r')" >> $GITHUB_OUTPUT
- name: Cypress - run installation wizard test
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
- name: Cypress - run installation wizard test
run: >-
yarn cy:run --browser chrome --spec
"cypress/e2e/adminInstallation/**/*.cy.js"
working-directory: ${{ needs.baseBranch.outputs.base-branch }}
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -804,7 +804,7 @@ jobs:
}}
environment: next
env:
NODE_OPTIONS: '--max_old_space_size=4096'
NODE_OPTIONS: "--max_old_space_size=4096"
YARN_ENABLE_IMMUTABLE_INSTALLS: false
CYPRESS_MAILOSAUR_API_KEY: ${{ secrets.CYPRESS_MAILOSAUR_API_KEY }}
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
Expand Down
54 changes: 29 additions & 25 deletions .github/workflows/wac/pullRequestsCommandCypress.wac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
createYarnCacheSteps,
createInstallBuildSteps,
createGlobalBuildCacheSteps,
createRunBuildCacheSteps
createRunBuildCacheSteps,
withCommonParams
} from "./steps";
import {
NODE_OPTIONS,
Expand Down Expand Up @@ -153,30 +154,33 @@ const createCypressJobs = (dbSetup: string) => {
}
},
...createDeployWebinySteps({ workingDirectory: DIR_TEST_PROJECT }),
{
name: "Deployment Summary",
"working-directory": DIR_WEBINY_JS,
run: `${runNodeScript(
"printDeploymentSummary",
`../${DIR_TEST_PROJECT}`
)} >> $GITHUB_STEP_SUMMARY`
},
{
name: "Create Cypress config",
"working-directory": DIR_WEBINY_JS,
run: `yarn setup-cypress --projectFolder ../${DIR_TEST_PROJECT}`
},
{
name: "Save Cypress config",
id: "save-cypress-config",
"working-directory": DIR_WEBINY_JS,
run: "echo \"cypress-config=$(cat cypress-tests/cypress.config.ts | tr -d '\\t\\n\\r')\" >> $GITHUB_OUTPUT"
},
{
name: "Cypress - run installation wizard test",
"working-directory": DIR_WEBINY_JS,
run: 'yarn cy:run --browser chrome --spec "cypress/e2e/adminInstallation/**/*.cy.js"'
}
...withCommonParams(
[
{
name: "Deployment Summary",
run: `${runNodeScript(
"printDeploymentSummary",
`../${DIR_TEST_PROJECT}`
)} >> $GITHUB_STEP_SUMMARY`
},
{
name: "Create Cypress config",
run: `yarn setup-cypress --projectFolder ../${DIR_TEST_PROJECT}`
},
{
name: "Save Cypress config",
id: "save-cypress-config",
run: "echo \"cypress-config=$(cat cypress-tests/cypress.config.ts | tr -d '\\t\\n\\r')\" >> $GITHUB_OUTPUT"
},
{
name: "Cypress - run installation wizard test",
run: 'yarn cy:run --browser chrome --spec "cypress/e2e/adminInstallation/**/*.cy.js"'
}
],
{
"working-directory": DIR_WEBINY_JS
}
)
]
});

Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/wac/push.wac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ import {
createInstallBuildSteps,
createRunBuildCacheSteps,
createSetupVerdaccioSteps,
createYarnCacheSteps
createYarnCacheSteps,
withCommonParams
} from "./steps";

const withCommonParams = (
steps: NonNullable<NormalJob["steps"]>,
commonParams: Record<string, any>
) => steps.map(step => ({ ...step, ...commonParams }));

const createPushWorkflow = (branchName: string) => {
const ucFirstBranchName = branchName.charAt(0).toUpperCase() + branchName.slice(1);

Expand Down

0 comments on commit fef791e

Please sign in to comment.