-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (45 loc) · 1.6 KB
/
unit-tests.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
name: Salesforce CI/CD
on:
pull_request:
branches:
- '**'
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
PBO_AUTH_URL: ${{ secrets.PBO_AUTH_URL }}
steps:
- name: Checkout This Repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Salesforce CLI
run: npm install @salesforce/cli --global
- name: Create authentication file from secret
run: echo ${PBO_AUTH_URL} > secret.json
- name: Authenticate to Dev Hub
run: sf org login sfdx-url -f secret.json --set-default-dev-hub
- name: Create Scratch Org
run: sf org create scratch -f config/project-scratch-def.json --set-default --alias ScratchOrg -y 1
- name: Checkout Apex-Library Repository
uses: actions/checkout@v4
with:
repository: Adyen/adyen-apex-api-library
ref: develop
path: dependency-repo
- name: Push Apex Lib Source to Scratch Org
run: |
cd dependency-repo
sf project deploy start --target-org ScratchOrg
- name: Checkout This Repository Back
uses: actions/checkout@v4
- name: Deploy This Repository Code
run: sf project deploy start --target-org ScratchOrg --ignore-conflicts
- name: Run Apex tests
run: sf apex run test --target-org ScratchOrg --code-coverage --synchronous
- name: Delete Scratch Org
if: always()
run: sf org delete scratch --target-org ScratchOrg --no-prompt