Skip to content

Instantly share code, notes, and snippets.

@garvitkhandelwal-atrium
Last active November 12, 2022 00:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save garvitkhandelwal-atrium/699cbb624e5d1805b9de14e99b0dc964 to your computer and use it in GitHub Desktop.
Save garvitkhandelwal-atrium/699cbb624e5d1805b9de14e99b0dc964 to your computer and use it in GitHub Desktop.
This is a sample workflow
name: Sample Workflow
on:
push:
branches: [ master ]
paths:
- 'force-app/**'
pull_request:
branches: [ master ]
paths:
- 'force-app/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event_name == 'push'
- uses: actions/setup-node@v1
with:
node-version: '>=14'
check-latest: true
- name: Install Salesforce CLI
run: |
npm install sfdx-cli
node_modules/sfdx-cli/bin/run --version
node_modules/sfdx-cli/bin/run plugins --core
- name: 'Populate auth file with SFDX_URL secret'
shell: bash
run: 'echo ${{ secrets.SFDX_LR_TEST_URL}} > SFDX_QA'
- name: 'Authenticate against dev hub'
run: node_modules/sfdx-cli/bin/run force:auth:sfdxurl:store -f SFDX_QA -s -a LRQA
- name: Run Apex test
run:
node_modules/sfdx-cli/bin/run force:apex:test:run --resultformat tap --codecoverage -c -r human
- name: Deploy source
id: Deploy
if: github.event_name == 'push'
run:
node_modules/sfdx-cli/bin/run force:source:deploy -p diffdeploy/force-app -u LRQA --json --loglevel fatal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment