30 lines
1.1 KiB
YAML
30 lines
1.1 KiB
YAML
name: Create a Scratch Org, Push Source and Run Apex Tests
|
|
|
|
on:
|
|
pull_request_target:
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{github.event.pull_request.head.ref}}
|
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
- name: Install SFDX CLI and authorize DevHub
|
|
uses: sfdx-actions/setup-sfdx@v1
|
|
with:
|
|
sfdx-auth-url: ${{ secrets.SFDX_AUTH_URL }}
|
|
- run: echo y | sfdx force:org:list
|
|
- run: echo y | sfdx plugins:install shane-sfdx-plugins
|
|
- run: sfdx force:org:create -f config/project-scratch-def.json --setdefaultusername -d 1
|
|
- run: sfdx shane:github:src:install -c -g apex-enterprise-patterns -r fflib-apex-mocks -p sfdx-source/apex-mocks
|
|
- run: sfdx shane:github:src:install -c -g apex-enterprise-patterns -r fflib-apex-common -p sfdx-source/apex-common
|
|
- run: sfdx force:source:push --forceoverwrite
|
|
- run: sfdx force:apex:test:run --codecoverage --resultformat human --wait 5
|
|
- name: Destroy scratch org
|
|
run: sfdx force:org:delete -p
|
|
if: always()
|