-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (40 loc) · 1.36 KB
/
unit-test.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
# Unique name for this workflow
name: Run Unit Tests
# Definition when the workflow should run
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
# Jobs to be executed
jobs:
unit-tests:
runs-on: ubuntu-latest
container: dxatscale/sfpowerscripts
steps:
# Checkout the code in the pull request
- name: "Checkout source code"
uses: actions/checkout@v2
with:
fetch-depth: 0
# Copy Auth URL to file
- name: "Copy Auth URL to file"
shell: bash
run: |
echo "${{ secrets.DEVHUB_AUTH_URL }}" > ./AUTH_URL
# Authorised Org
- name: "Authenicate Org"
run: "sfdx auth:sfdxurl:store -f ./AUTH_URL -a devhub"
# Create Scratch Org
- name: "Create New Scratch Org"
run: sfdx force:org:create -f config/project-scratch-def.json -a scratch-org -s -d 1 -v devhub
# Install Package Dependicies to Org
- name: 'Install Package Dependencies to Org'
run: 'sfdx sfpowerkit:package:dependencies:install -u scratch-org -v devhub -r'
# Validate Against Org
- name: 'Push source to scratch org'
run: 'sfdx sfpowerscripts:orchestrator:validateAgainstOrg -u scratch-org'
# Delete Scratch Org
- name: 'Delete Scratch Org'
run: 'sfdx force:org:delete -p -u scratch-org'