Skip to content

Commit

Permalink
adding the deploy and test script
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJohnMDaniel committed Nov 6, 2023
1 parent 3dc91ca commit 2158b87
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy.and.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Create a Scratch Org, Push Source and Run Apex Tests

on:
push:
pull_request_target:
workflow_dispatch:

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: apex-enterprise-patterns/setup-sfdx@v1 #We're using a fork of https://github.com/sfdx-actions/setup-sfdx for safety
with:
sfdx-auth-url: ${{ secrets.DEVHUB_SFDXURL }}
- run: sfdx force:config:set defaultdevhubusername=SFDX-ENV -g #Even though the setup-sfdx action uses --setdefaultdevhubusername, it doesn't seem to stick since it uses --setdefaultusername so we brute force it here
- 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 force-di -p force-di
- 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()

0 comments on commit 2158b87

Please sign in to comment.