Files
fflib-apex-extensions/.github/workflows/deploy.and.test.yml
T
2021-06-28 11:48:08 +01:00

31 lines
1.1 KiB
YAML

name: Create a Scratch Org, Push Source and Run Apex Tests
on:
push:
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
- run: sfdx force:apex:test:run -w 5
- name: Destroy scratch org
run: sfdx force:org:delete -p
if: always()