-
Notifications
You must be signed in to change notification settings - Fork 17
/
config.yml
70 lines (70 loc) · 2.79 KB
/
config.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
version: 2
jobs:
build:
docker:
- image: circleci/openjdk:latest-node-browsers
steps:
- checkout
- restore_cache:
keys:
- sfdx-6.8.2-local
- run:
name: Install Salesforce DX
command: |
if [ ! -d node_modules/sfdx-cli ]; then
export SFDX_AUTOUPDATE_DISABLE=true
export SFDX_USE_GENERIC_UNIX_KEYCHAIN=true
export SFDX_DOMAIN_RETRY=300
npm install sfdx-cli@6.8.2
node_modules/sfdx-cli/bin/run --version
node_modules/sfdx-cli/bin/run plugins --core
fi
- save_cache:
key: sfdx-6.8.2-local
paths:
- node_modules
- run:
name: Create Scratch Org
command: |
openssl aes-256-cbc -k $KEY -in assets/server.key.enc -out assets/server.key -d -md md5
node_modules/sfdx-cli/bin/run force:auth:jwt:grant --clientid $CONSUMERKEY --jwtkeyfile assets/server.key --username $USERNAME --setdefaultdevhubusername -a DevHub
node_modules/sfdx-cli/bin/run force:org:create -v DevHub -s -f config/project-scratch-def.json -a scratch
- run:
name: Remove Server Key
when: always
command: |
rm assets/server.key
- run:
name: Install Lightning Testing Service
command: |
node_modules/sfdx-cli/bin/run force:lightning:test:install -t jasmine
- run:
name: Push Source
command: |
node_modules/sfdx-cli/bin/run force:source:push -u scratch
- run:
name: Run Apex Tests
command: |
mkdir ~/tests
mkdir ~/tests/apex
node_modules/sfdx-cli/bin/run force:apex:test:run -u scratch -c -r human -d ~/tests/apex -w 9999
- run:
name: Run Lightning Tests
command: |
mkdir ~/tests/lightning
node_modules/sfdx-cli/bin/run force:lightning:test:run -d ~/tests/lightning -r human -a lightningTests.app -o
- run:
name: Push to Codecov.io (Optional Step)
command: |
cp ~/tests/apex/test-result-codecoverage.json .
bash <(curl -s https://codecov.io/bash)
- run:
name: Clean Up
when: always
command: |
node_modules/sfdx-cli/bin/run force:org:delete -u scratch -p
rm ~/tests/apex/*.txt ~/tests/apex/test-result-7*.json
- store_artifacts:
path: ~/tests
- store_test_results:
path: ~/tests