Skip to content

Commit 1fb7d2e

Browse files
committed
Adds GH Action Workflow to build Sample Code and run tests
1 parent 8746dcb commit 1fb7d2e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/deploy.and.test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Create a Scratch Org, Push Source and Run Apex Tests
2+
3+
on:
4+
push:
5+
pull_request_target:
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
ref: ${{github.event.pull_request.head.ref}}
16+
repository: ${{github.event.pull_request.head.repo.full_name}}
17+
- name: Install SFDX CLI and authorize DevHub
18+
uses: apex-enterprise-patterns/setup-sfdx@v1 #We're using a fork of https://github.com/sfdx-actions/setup-sfdx for safety
19+
with:
20+
sfdx-auth-url: ${{ secrets.DEVHUB_SFDXURL }}
21+
- run: echo y | sfdx plugins:install shane-sfdx-plugins
22+
- run: sfdx force:org:create -f config/project-scratch-def.json --setdefaultusername -d 1
23+
- run: sfdx shane:github:src:install -c -g apex-enterprise-patterns -r fflib-apex-mocks -p sfdx-source/apex-mocks
24+
- run: sfdx shane:github:src:install -c -g apex-enterprise-patterns -r fflib-apex-common -p sfdx-source/apex-common
25+
- run: sfdx force:source:push
26+
- run: sfdx force:apex:test:run -w 5
27+
- name: Destroy scratch org
28+
run: sfdx force:org:delete -p
29+
if: always()
30+

0 commit comments

Comments
 (0)