Skip to content

Automated packaing

Automated packaing #10

Workflow file for this run

name: Pull Request to Develop
on:
pull_request:
branches: [ dev ]
jobs:
validate_pull_request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Salesforce CLI
run: |
npm install --global sfdx-cli
- name: Install jq
run: |
sudo apt-get install jq
- name: Populate auth file
shell: bash
run: 'echo ${{secrets.DEVHUB_SFDX_URL}} > ./DEVHUB_SFDX_URL.txt'
- name: Authenticate Dev Hub
run: |
'sfdx force:auth:sfdxurl:store -f ./DEVHUB_SFDX_URL.txt -a devhub -d'
- name: Create scratch org
run: 'sfdx force:org:create -f config/project-scratch-def.json -a ci_scratch -s -d 1'
- name: Push source to scratch org
run: 'sfdx force:source:push'
- name: Check code coverage
run: |
sfdx force:apex:test:run --codecoverage --resultformat json --synchronous --testlevel RunLocalTests --wait 10 > tests.json
coverage=$(jq .result.summary.orgWideCoverage tests.json | grep -Eo "[[:digit:]]+")
test $coverage -ge 75
- name: Delete scratch org
if: always()
run: 'sf org delete scratch -p -o ci_scratch'