-
Notifications
You must be signed in to change notification settings - Fork 45
51 lines (42 loc) · 1.65 KB
/
continuousIntegration.yml
File metadata and controls
51 lines (42 loc) · 1.65 KB
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
name: Continuous Integration
on:
pull_request:
types: [opened, reopened, synchronize, edited]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ">=20"
check-latest: true
- name: Install Salesforce CLI + Scanner
run: |
npm install @salesforce/cli -g
sf --version
sf plugins --core
sf plugins install @salesforce/sfdx-scanner
- name: Run SFDX Scanner - Report findings as comments
uses: mitchspano/sfdx-scan-pull-request@v0.1.15
with:
severity-threshold: 4
report-mode: comments
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Authenticate into DevHub
run: |
echo "${SALESFORCE_JWT_SECRET_KEY}" > server.key
sf org login jwt --client-id ${{ secrets.SALESFORCE_CONSUMER_KEY }} --jwt-key-file server.key --username ${{ secrets.SALESFORCE_DEVHUB_USERNAME}} --set-default-dev-hub --alias devhub
env:
SALESFORCE_JWT_SECRET_KEY: ${{ secrets.SALESFORCE_JWT_SECRET_KEY }}
- name: Validate Contents in a Scratch Org
run: |
sf org create scratch --target-dev-hub devhub --set-default --definition-file config/project-scratch-def.json --alias scratchOrg --duration-days 1
sf project deploy start --target-org scratchOrg
sf apex run test --code-coverage --result-format human --synchronous
sf org delete scratch --no-prompt --target-org scratchOrg