Skip to content

Commit

Permalink
Merge pull request #24 from ncino/feat/DO-3489/cmitzel
Browse files Browse the repository at this point in the history
Feat/DO-3489/cmitzel
  • Loading branch information
cmitzel-ncino authored Jan 27, 2025
2 parents 887b150 + 2e675ec commit ee76422
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 32 deletions.
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"workbench.colorCustomizations": {
"commandCenter.border": "#e7e7e799",
"sash.hoverBorder": "#21c58b",
"statusBar.background": "#1a996c",
"statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#21c58b",
"statusBarItem.remoteBackground": "#1a996c",
"statusBarItem.remoteForeground": "#e7e7e7",
"tab.activeBorder": "#21c58b",
"titleBar.activeBackground": "#1a996c",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#1a996c99",
"titleBar.inactiveForeground": "#e7e7e799"
},
"peacock.color": "#1a996c"
}
75 changes: 58 additions & 17 deletions workflow-templates/1gp-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ on:
push:
branches:
- release
- "*.*.x"
- '*.*.x'

pull_request:
branches:
- release
- "*.*.x"
- '*.*.x'

workflow_dispatch:
inputs:
Expand Down Expand Up @@ -56,30 +56,67 @@ on:

auto-promote:
description: Whether to auto promote the package
value: "false"
value: 'false'

permissions:
id-token: write # This is required for requesting the ID token for AWS actions
contents: read # This is required for actions/checkout

concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: ${{ github.ref != 'refs/heads/release' }}

env:
DD_AGENT_MAJOR_VERSION: "7"
DD_API_KEY: "${{ secrets.DD_API_KEY }}"
DD_APP_KEY: "${{ secrets.DD_APP_KEY }}"
DD_AGENT_MAJOR_VERSION: '7'
DD_API_KEY: '${{ secrets.DD_API_KEY }}'
DD_APP_KEY: '${{ secrets.DD_APP_KEY }}'
DD_SITE: datadoghq.com
DEVOPS_SCRIPTS_PATH: "./devops-utility-belt/scripts"
DEVOPS_SCRIPTS_PATH: './devops-utility-belt/scripts'
GIT_BASE_BRANCH: ${{ github.base_ref }}
GIT_BRANCH: ${{ github.ref_name }}
GITHUB_TOKEN: "${{ secrets.CI_USER_REPO_ACCESS_TOKEN }}"
GITHUB_TOKEN: '${{ secrets.CI_USER_REPO_ACCESS_TOKEN }}'
RELEASE_FULLNAME: nCino Companies House (UK)
REPO_NAME: ${{ github.event.repository.name }}

jobs:
Path-Filtering:
outputs:
apex-changed: ${{ steps.path-filtering.outputs.apex-changed }}
markdown-changed: ${{ steps.path-filtering.outputs.markdown-changed }}
non-markdown-changed: ${{ steps.path-filtering.outputs.non-markdown-changed }}
runs-on: ubuntu-latest
steps:
- name: πŸ«₯ Checkout repo 😐
uses: actions/checkout@v4
with:
token: ${{ secrets.CI_USER_REPO_ACCESS_TOKEN }}
sparse-checkout: 'sfdx-project.json'

- name: Get Namespace
run: echo "NAMESPACE=$(jq -r '.namespace' sfdx-project.json)" >> $GITHUB_ENV

# Uses the action by @dorny to filter paths
# More info can be found at https://github.com/dorny/paths-filter
- name: Run Path Filtering
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # current version 3.0.2
id: path-filtering
with:
filters: |
apex-changed:
- "src/${{ env.NAMESPACE }}/**/*.cls"
- "src/${{ env.NAMESPACE }}/**/*.trigger"
- "src/${{ env.NAMESPACE }}/**/*.component"
- "src/${{ env.NAMESPACE }}/**/*.page"
- "src/${{ env.NAMESPACE }}/**/*.*-meta.xml"
markdown-changed:
- '**/*.md'
non-markdown-changed:
- '!**/*.md'
list-files: 'json'
token: ${{ env.GITHUB_TOKEN }}

CI-build-and-test:
needs: Path-Filtering
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -97,22 +134,23 @@ jobs:
- name: πŸ—ƒοΈ Checkout Repo πŸ—ƒοΈ
uses: actions/checkout@v4
with:
token: "${{ steps.app-token.outputs.token }}"
token: '${{ steps.app-token.outputs.token }}'
ref: ${{ inputs.ref }}

- name: πŸ› οΈ Force Repository Setup πŸ› οΈ
uses: ncino/action-force-setup@v2
with:
dev-hub-auth-url: "${{ REPLACE_DEVHUB_URL_SECRET }}"
ci-ncino-ssh-private-signing-key: ${{ REPLACE_SSH_PRIVATE_SIGNING_KEY_SECRET }}
ci-ncino-ssh-public-signing-key: ${{ REPLACE_SSH_PUBLIC_SIGNING_KEY_SECRET }}
dev-hub-auth-url: '${{ secrets.DEVOPS_DEV_HUB_AUTH_URL }}'
ci-ncino-ssh-private-signing-key: ${{ secrets.CI_NCINO_SSH_PRIVATE_SIGNING_KEY }}
ci-ncino-ssh-public-signing-key: ${{ secrets.CI_NCINO_SSH_PUBLIC_SIGNING_KEY }}
git-committer-name: ci-ncino
git-committer-email: pdedevops@ncino.com

#######################################################
###### πŸ—οΈ BUILD AND PACKAGE πŸ“¦ ######
#######################################################
- name: πŸ•΅οΈβ€β™€οΈ Validate config XML πŸ•΅οΈβ€β™€οΈ
if: ${{ needs.Path-Filtering.outputs.non-markdown-changed == 'true' }}
uses: ncino/action-validate-xml@v1

# Uncomment if you have Angular or AngularJS jest tests
Expand All @@ -126,21 +164,24 @@ jobs:

- name: πŸ‘©β€πŸŒΎ Get orgfarm org πŸ‘¨β€πŸŒΎ
id: setup-org
if: ${{ needs.Path-Filtering.outputs.apex-changed == 'true' }}
uses: ncino/action-org-setup/org-provision-action@v3
with:
capability: "{{REPLACE_REPO_NAME}}"
capability: '${{ github.event.repository.name }}'
clean-org: ${{ inputs.clean-org }}
has-namespace: true
github-token: "${{ secrets.CI_USER_REPO_ACCESS_TOKEN }}"
orgfarm-api-key: "${{ secrets.ORG_FARM_API_KEY }}"
github-token: '${{ secrets.CI_USER_REPO_ACCESS_TOKEN }}'
orgfarm-api-key: '${{ secrets.ORG_FARM_API_KEY }}'
orgfarm-api-url: ${{ vars.ORGFARM_API_URL }}
package-updater: install-dependencies-action
preserve-org: ${{ inputs.preserve-org }}

- name: 🚒 Deploy source and encrypt πŸ’Ό
if: ${{ needs.Path-Filtering.outputs.apex-changed == 'true' }}
uses: ncino/action-org-setup/org-source-push-action@v2

- name: πŸ§ͺ Force Apex Tests πŸ§ͺ
if: ${{ needs.Path-Filtering.outputs.apex-changed == 'true' }}
uses: ncino/action-force-apex-tests@v4
with:
auth-url: ${{ steps.setup-org.outputs.auth-url }}
Expand All @@ -159,7 +200,7 @@ jobs:
uses: ncino/action-org-setup/org-cleanup-action@v3
with:
orgfarm-api-url: ${{ vars.ORGFARM_API_URL }}
orgfarm-api-key: "${{ secrets.ORG_FARM_API_KEY }}"
orgfarm-api-key: '${{ secrets.ORG_FARM_API_KEY }}'
preserve-org: ${{ inputs.preserve-org }}

- name: πŸ“ Export Summary πŸ“
Expand Down
73 changes: 58 additions & 15 deletions workflow-templates/hybrid-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
branches:
- release
- "*.*.x"
- '*.*.x'

workflow_dispatch:
inputs:
Expand Down Expand Up @@ -52,31 +52,68 @@ on:

auto-promote:
description: Whether to auto promote the package
value: "false"
value: 'false'

permissions:
id-token: write # This is required for requesting the ID token for AWS actions
contents: read # This is required for actions/checkout

concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: ${{ github.ref != 'refs/heads/release' }}

env:
COMMIT_SHA1: ${{ github.sha }}
DD_AGENT_MAJOR_VERSION: "7"
DD_API_KEY: "${{ secrets.DD_API_KEY }}"
DD_APP_KEY: "${{ secrets.DD_APP_KEY }}"
DD_AGENT_MAJOR_VERSION: '7'
DD_API_KEY: '${{ secrets.DD_API_KEY }}'
DD_APP_KEY: '${{ secrets.DD_APP_KEY }}'
DD_SITE: datadoghq.com
DEVOPS_SCRIPTS_PATH: "./devops-utility-belt/scripts"
DEVOPS_SCRIPTS_PATH: './devops-utility-belt/scripts'
GIT_BASE_BRANCH: ${{ github.base_ref }}
GIT_BRANCH: ${{ github.ref_name }}
GITHUB_TOKEN: "${{ secrets.CI_USER_REPO_ACCESS_TOKEN }}"
GITHUB_TOKEN: '${{ secrets.CI_USER_REPO_ACCESS_TOKEN }}'
RELEASE_FULLNAME: $PACKAGE_NAME
REPO_NAME: ${{ github.event.repository.name }}

jobs:
Path-Filtering:
outputs:
apex-changed: ${{ steps.path-filtering.outputs.apex-changed }}
markdown-changed: ${{ steps.path-filtering.outputs.markdown-changed }}
non-markdown-changed: ${{ steps.path-filtering.outputs.non-markdown-changed }}
runs-on: ubuntu-latest
steps:
- name: πŸ«₯ Checkout repo 😐
uses: actions/checkout@v4
with:
token: ${{ secrets.CI_USER_REPO_ACCESS_TOKEN }}
sparse-checkout: 'sfdx-project.json'

- name: Get Namespace
run: echo "NAMESPACE=$(jq -r '.namespace' sfdx-project.json)" >> $GITHUB_ENV

# Uses the action by @dorny to filter paths
# More info can be found at https://github.com/dorny/paths-filter
- name: Run Path Filtering
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # current version 3.0.2
id: path-filtering
with:
filters: |
apex-changed:
- "src/${{ env.NAMESPACE }}/**/*.cls"
- "src/${{ env.NAMESPACE }}/**/*.trigger"
- "src/${{ env.NAMESPACE }}/**/*.component"
- "src/${{ env.NAMESPACE }}/**/*.page"
- "src/${{ env.NAMESPACE }}/**/*.*-meta.xml"
markdown-changed:
- '**/*.md'
non-markdown-changed:
- '!**/*.md'
list-files: 'json'
token: ${{ env.GITHUB_TOKEN }}

CI-build-and-test:
needs: Path-Filtering
runs-on: ubuntu-latest
outputs:
package-receipt: ${{ steps.create-package.outputs.receipt }}
Expand All @@ -94,15 +131,16 @@ jobs:
- name: πŸ—ƒοΈ Checkout Repo πŸ—ƒοΈ
uses: actions/checkout@v4
with:
token: "${{ steps.app-token.outputs.token }}"
token: '${{ steps.app-token.outputs.token }}'
ref: ${{ inputs.ref }}

- name: πŸ› οΈ Force Repository Setup πŸ› οΈ
if: ${{ needs.Path-Filtering.outputs.non-markdown-changed == 'true' }}
uses: ncino/action-force-setup@v2
with:
dev-hub-auth-url: "${{ secrets.DEVOPS_DEV_HUB_AUTH_URL }}"
ci-ncino-ssh-private-signing-key: "${{ secrets.CI_NCINO_SSH_PRIVATE_SIGNING_KEY }}"
ci-ncino-ssh-public-signing-key: "${{ secrets.CI_NCINO_SSH_PUBLIC_SIGNING_KEY }}"
dev-hub-auth-url: '${{ secrets.DEVOPS_DEV_HUB_AUTH_URL }}'
ci-ncino-ssh-private-signing-key: '${{ secrets.CI_NCINO_SSH_PRIVATE_SIGNING_KEY }}'
ci-ncino-ssh-public-signing-key: '${{ secrets.CI_NCINO_SSH_PUBLIC_SIGNING_KEY }}'
git-committer-name: ci-ncino
git-committer-email: pdedevops@ncino.com
setup-salesforce-version: latest
Expand All @@ -111,27 +149,31 @@ jobs:
###### πŸ—οΈ BUILD AND PACKAGE πŸ“¦ ######
#######################################################
- name: πŸ•΅οΈβ€β™€οΈ Validate config XML πŸ•΅οΈβ€β™€οΈ
if: ${{ needs.Path-Filtering.outputs.non-markdown-changed == 'true' }}
uses: ncino/action-validate-xml@v1

- name: πŸ“¦ Create a 2gp Package Version πŸ“¦
if: ${{ needs.Path-Filtering.outputs.apex-changed == 'true' }}
id: create-package
uses: ncino/action-create-package@v1
with:
skip-validation: ${{ inputs.skip-validation }}

- name: πŸ‘©β€πŸŒΎ Get and Setup Org πŸ‘¨β€πŸŒΎ
if: ${{ needs.Path-Filtering.outputs.apex-changed == 'true' }}
id: setup-org
uses: ncino/action-org-setup/org-provision-action@v3
with:
clean-org: ${{ inputs.clean-org }}
github-token: "${{ secrets.CI_USER_REPO_ACCESS_TOKEN }}"
github-token: '${{ secrets.CI_USER_REPO_ACCESS_TOKEN }}'
has-namespace: false
orgfarm-api-key: "${{ secrets.ORG_FARM_API_KEY }}"
orgfarm-api-key: '${{ secrets.ORG_FARM_API_KEY }}'
orgfarm-api-url: ${{ vars.ORGFARM_API_URL }}
package-updater: install-dependencies-action
preserve-org: ${{ inputs.preserve-org }}

- name: πŸ”­ Install package version to scratch org πŸ‘©β€πŸš€
if: ${{ needs.Path-Filtering.outputs.apex-changed == 'true' }}
uses: ncino/action-org-setup/org-install-package-action@v3
with:
auth-url: ${{ steps.setup-org.outputs.auth-url }}
Expand All @@ -140,6 +182,7 @@ jobs:
wait: 120

- name: πŸ§ͺ Force Apex Tests πŸ§ͺ
if: ${{ needs.Path-Filtering.outputs.apex-changed == 'true' }}
uses: ncino/action-force-apex-tests@v4
with:
auth-url: ${{ steps.setup-org.outputs.auth-url }}
Expand All @@ -152,7 +195,7 @@ jobs:
uses: ncino/action-org-setup/org-cleanup-action@v3
with:
orgfarm-api-url: ${{ vars.ORGFARM_API_URL }}
orgfarm-api-key: "${{ secrets.ORG_FARM_API_KEY }}"
orgfarm-api-key: '${{ secrets.ORG_FARM_API_KEY }}'
preserve-org: ${{ inputs.preserve-org }}

- name: πŸ“ Export Summary πŸ“
Expand Down

0 comments on commit ee76422

Please sign in to comment.