Minlopro: Knowledge in DigEx #1063
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
name: Validate Pull Request Changes 🔧 | |
# Trigger Events | |
on: | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
branches: | |
- develop | |
# Jobs | |
jobs: | |
# Event = 'Pull Request' | |
run-prettier-checks: | |
runs-on: ubuntu-latest | |
continue-on-error: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: 'Install NPM Dependencies' | |
run: npm install | |
- name: 'Run Prettier Checks Against Changes Files' | |
run: | | |
git checkout ${{github.base_ref}} | |
git pull | |
git checkout ${{github.head_ref}} | |
git pull | |
echo ${{github.base_ref}} | bash ./scripts/deploy/run_prettier_check_against_changed_files.sh | |
run-jest-tests: | |
runs-on: ubuntu-latest | |
continue-on-error: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: 'Install NPM Dependencies' | |
run: npm install | |
- name: 'Run Jest Tests with Coverage' | |
run: npm run jest:coverage | |
run-shell-check: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ludeeus/action-shellcheck@master | |
with: | |
ignore_paths: src | |
validate-deployment-to-org: | |
needs: [ run-prettier-checks, run-jest-tests, run-shell-check ] | |
environment: "Minlopro DevHub" | |
env: | |
SF_AUTH_URL: ${{ secrets.SF_AUTH_URL }} | |
SF_ADMIN_EMAIL: ${{ vars.SF_ADMIN_EMAIL }} | |
SF_GITHUB_WEBHOOK_SECRET: ${{ secrets.SF_GITHUB_WEBHOOK_SECRET }} | |
SF_GOOGLE_API_KEY: ${{ secrets.SF_GOOGLE_API_KEY }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: 'Install Salesforce CLI & Authorize Target Org' | |
run: | | |
bash ./scripts/deploy/build.sh | |
bash ./scripts/deploy/authorize_org.sh --sfdxUrl "$SF_AUTH_URL" --orgAlias "TargetOrg" | |
- name: 'Generate Delta Manifests' | |
run: | | |
git checkout ${{github.base_ref}} | |
git pull | |
git checkout ${{github.head_ref}} | |
git pull | |
# Generate manifests via SGD plugin; | |
branchesInfoFile="build/branches-info.txt" | |
touch "$branchesInfoFile" | |
# From | |
echo ${{github.base_ref}} >> $branchesInfoFile | |
# To | |
echo ${{github.head_ref}} >> $branchesInfoFile | |
bash ./scripts/deploy/sgd_generate_manifests.sh < "$branchesInfoFile" | |
- name: "Run PRE-Deploy Scripts" | |
run: echo "TargetOrg" | bash ./scripts/deploy/pre/run_pre.sh | |
- name: 'Check-Only Deploy Source to Target Org' | |
run: echo "TargetOrg" | bash ./scripts/deploy/validate.sh |