-
Notifications
You must be signed in to change notification settings - Fork 75
77 lines (65 loc) · 2.22 KB
/
ci-push.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
#.github/workflows/main.yml
name: Validate Against QA
on:
push:
branches:
- developer
paths:
- './sfdxsrc'
jobs:
environment-setup:
name: environment-setup
runs-on: ubuntu-latest
steps:
# Checkout the source code
- name: 'Checkout source code'
uses: actions/checkout@v2
# Cache node_modules to speed up the process
- name: 'Restore node_modules cache'
id: cache-npm
uses: actions/cache@v1
with:
path: node_modules
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-${{ env.cache-name }}-
npm-
# Install npm dependencies for Prettier and Jest
- name: 'Install npm dependencies'
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci
validate:
name: Validate
runs-on: ubuntu-latest
if: github.event == 'push'
steps:
# Install Salesforce CLI
- name: 'Install Salesforce CLI'
run: |
wget https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz
mkdir sfdx-cli
tar xJf sfdx-linux-amd64.tar.xz -C sfdx-cli --strip-components 1
./sfdx-cli/install
# Install Salesforce CLI Scanner
- name: 'Install Salesforce CLI Scanner'
run: sfdx plugins:install @salesforce/sfdx-scanner
# Checkout the source code
- name: 'Checkout source code'
uses: actions/checkout@v2
# Run Salesforce CLI Scanner For Security checks
- name: 'Scan For Security Exceptions'
run: sfdx scanner:run -c=Security -t=./sfdxsrc -f=json -v
# Deploy source to org
- name: 'Push source to org'
run: sfdx force:source:deploy
# Assign permissionset
# - name: 'Assign permissionset to default user'
# run: sfdx force:user:permset:assign -n recipes
# Run Apex tests in scratch org
- name: 'Run Apex tests'
run: sfdx force:apex:test:run -c -r human -d ./tests/apex -w 20
# Upload code coverage data
- name: 'Upload code coverage for Apex to Codecov.io'
uses: codecov/codecov-action@v1
with:
flags: Apex