BCMOHAD-18354 || Updating create-build.yml file #929
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Check | |
on: [pull_request_target] | |
jobs: | |
build-check: | |
runs-on: ubuntu-latest | |
env: | |
SF_DISABLE_SOURCE_MEMBER_POLLING: true | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: 'Install Salesforce CLI' | |
run: | | |
wget https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-linux-x64.tar.xz | |
mkdir ~/sfdx | |
tar xJf sf-linux-x64.tar.xz -C ~/sfdx --strip-components 1 | |
echo "$HOME/sfdx/bin" >> $GITHUB_PATH | |
~/sfdx/bin/sf version | |
- name: Authenticate DevHub | |
run: | | |
echo ${{ secrets.SALESFORCE_DEVHUB_AUTH }} > sfdxurl.txt | |
sfdx auth:sfdxurl:store --sfdxurlfile sfdxurl.txt --setalias devhub --setdefaultdevhubusername | |
- name: Define CI org | |
run: sfdx force:org:create -v devhub -s -f config/project-scratch-def.json -a ciorg -d 1 | |
- name: Deploy source | |
run: | | |
sf project deploy start -d dev-app-pre -o ciorg | |
sf project deploy start -d force-app -o ciorg | |
sf project deploy start -d force-app/main/default/objects -o ciorg -w 15 | |
sf project deploy start -d force-app/main/default/queues -o ciorg -w 15 | |
sf project deploy start -d dev-app-post -o ciorg -c | |
# The changes were made in accordance with Salesforce recommendations to move from sfdx commands to sf-style commands | |
# sfdx force:source:push -u ciorg | |
- name: Assign permission set and set user role | |
run: | | |
sfdx force:user:permset:assign -u ciorg -n SA_Administrator | |
sfdx force:apex:execute -u ciorg -f scripts/apex/scratchorg-set-current-user.apex | |
- name: Run Apex test | |
run: sfdx force:apex:test:run -c -r human | |
- name: Delete scratch org | |
if: ${{ always() }} | |
run: sfdx force:org:delete -u ciorg -p |