-
Notifications
You must be signed in to change notification settings - Fork 7
85 lines (71 loc) · 2.8 KB
/
deploy.yml
File metadata and controls
85 lines (71 loc) · 2.8 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
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
# Unique name for this workflow
name: Deployment
on:
push:
paths-ignore:
- 'content/**'
- 'docs/**'
- 'examples/**'
- 'packages/**'
- '.forceignore'
- '.gitignore'
- '.prettierignore'
- '.prettierrc'
- 'Contributing.md'
- 'LICENSE'
- 'package.json'
- 'README.md'
- './**/README.md'
- 'sfdx-project.json'
jobs:
scratch-org-tests:
name: 'Scratch Org Tests'
runs-on: ubuntu-latest
environment: Test
steps:
# Checkout the code
- name: 'Checkout source code'
uses: actions/checkout@v2
- name: 'Setup node'
uses: actions/setup-node@v2
with:
node-version: '14'
- name: 'Install npm'
run: npm install
# 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
# Start remote testing
# Store secrets for dev hubs
- name: 'Populate DevHub Auth Files'
shell: bash
run: |
echo ${{ env.JONGPIE_DEVHUB_SFDX_URL }} > ./JONGPIE_DEVHUB_SFDX_URL.txt
env:
JONGPIE_DEVHUB_SFDX_URL: ${{ secrets.JONGPIE_DEVHUB_SFDX_URL }}
- name: 'Authorize Dev Hubs'
run: |
sfdx auth:sfdxurl:store --sfdxurlfile ./JONGPIE_DEVHUB_SFDX_URL.txt --setalias jongpie-devhub
- name: 'Create Scratch Org'
run: sfdx force:org:create --targetdevhubusername jongpie-devhub --definitionfile ./config/enterprise-scratch-def.json --setalias CustomMetadataSaver --setdefaultusername
- name: 'Deploy Metadata'
run: sfdx force:source:push
- name: Enable improved SFDX code coverage
run: export SFDX_IMPROVED_CODE_COVERAGE=true
- name: 'Run Apex Tests'
run: npm run test:apex
# Upload code coverage data for Apex
# codecov integration is currently disabled due to
# issues with parsing sfdx codecoverage files
# - name: 'Upload code coverage for Apex to Codecov.io'
# uses: codecov/codecov-action@v2.0.2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# flags: Apex
- name: 'Delete Scratch Org'
run: sfdx force:org:delete --json --noprompt
if: ${{ always() }}