File tree 1 file changed +53
-0
lines changed
1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Salesforce CI
2
+
3
+ # on:
4
+ # push:
5
+ # branches:
6
+ # - main
7
+ # pull_request:
8
+ # branches:
9
+ # - main
10
+
11
+ on :
12
+ workflow_dispatch :
13
+ inputs :
14
+ branch :
15
+ description : ' Branch to run the tests on'
16
+ required : true
17
+ default : ' main'
18
+
19
+ jobs :
20
+ build :
21
+ runs-on : ubuntu-latest
22
+
23
+ steps :
24
+ - name : Checkout repository
25
+ uses : actions/checkout@v2
26
+
27
+ - name : Install Salesforce CLI
28
+ uses : forcedotcom/sfdx-action@v1
29
+ with :
30
+ version : latest
31
+
32
+ # Store Secret for debhub
33
+ - name : Populate auth file with DEVHUB_SFDX_URL secrets
34
+ shell : bash
35
+ run : |
36
+ echo ${{ secrets.DEVHUB_SFDX_URL }} > ./DEVHUB_SFDX_URL.txt
37
+ secretFileSize=$(wc -c "./DEVHUB_SFDX_URL.txt" | awk '{print $1}')
38
+ if [ $secretFileSize == 1 ]; then
39
+ echo "DEVHUB_SFDX_URL secret is empty or not set. Is this workflow running on a fork? Exiting...";
40
+ exit 1;
41
+ fi
42
+
43
+ - name : Authenticate to Dev Hub
44
+ run : sfdx auth:sfdxurl:store -f ./DEVHUB_SFDX_URL.txt -a devhub -d
45
+
46
+ - name : Create Scratch Org
47
+ run : sfdx force:org:create -s -f config/project-scratch-def.json -a MyScratchOrg
48
+
49
+ - name : Push Source to Scratch Org
50
+ run : sfdx force:source:push -u MyScratchOrg
51
+
52
+ - name : Run Apex Tests
53
+ run : sfdx force:apex:test:run -u MyScratchOrg --wait 10 --resultformat human --codecoverage
You can’t perform that action at this time.
0 commit comments