-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (91 loc) · 2.96 KB
/
pull_request_workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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