-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (30 loc) · 1.1 KB
/
code-coverage.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
name: code-coverage
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: |
sudo npm install -g sfdx-cli
- name: Populate auth file
run: 'echo "${{ secrets.SALESFORCE_AUTH_URL }}" > ./SALESFORCE_AUTH_URL.txt'
- name: Authenticate Dev Hub
run: 'sfdx force:auth:sfdxurl:store -f ./SALESFORCE_AUTH_URL.txt -a devhub -d'
- name: Authenticate Target Org
run: 'sfdx force:auth:sfdxurl:store -f ./SALESFORCE_AUTH_URL.txt -a ciorg'
- name: Create Scratch Org
run: sfdx org create scratch -f config/project-scratch-def.json -a ciorg --set-default
- name: Deploy source
run: sfdx project deploy start
- name: Run Apex tests
run: sfdx apex run test -o ciorg --codecoverage --resultformat human -d ./
- name: Upload code coverage for Apex to Codecov.io
uses: codecov/codecov-action@v2
with:
flags: Apex
- name: Delete Scratch Org
if: always()
run: |
sfdx org delete scratch -o ciorg -p