Skip to content

Commit

Permalink
Merge pull request #8 from nylas/fix-package-version
Browse files Browse the repository at this point in the history
Fix package version
  • Loading branch information
LincolnRychecky authored Aug 21, 2024
2 parents cc8036c + adcc0cb commit 551b90a
Showing 1 changed file with 25 additions and 40 deletions.
65 changes: 25 additions & 40 deletions .github/workflows/apex-tests-pr.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,34 @@
name: Salesforce CI

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to run the tests on'
required: true
default: 'main'
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
- uses: actions/setup-node@v1
with:
node-version: '21.x'

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Salesforce CLI
run: |
npm install sfdx-cli
node_modules/sfdx-cli/bin/run --version
node_modules/sfdx-cli/bin/run plugins --core
# Store Secret for debhub
- name: Populate auth file with DEVHUB_SFDX_URL secrets
shell: bash
run: |
echo ${{ secrets.DEVHUB_SFDX_URL }} > ./DEVHUB_SFDX_URL.txt
secretFileSize=$(wc -c "./DEVHUB_SFDX_URL.txt" | awk '{print $1}')
if [ $secretFileSize == 1 ]; then
echo "DEVHUB_SFDX_URL secret is empty or not set. Is this workflow running on a fork? Exiting...";
exit 1;
fi
- name: Authenticate to Dev Hub
run: sfdx auth:sfdxurl:store -f ./DEVHUB_SFDX_URL.txt -a devhub -d

- name: Create Scratch Org
run: sfdx force:org:create -s -f config/project-scratch-def.json -a MyScratchOrg

- name: Push Source to Scratch Org
run: sfdx force:source:push -u MyScratchOrg

- name: Run Apex Tests
run: sfdx force:apex:test:run -u MyScratchOrg --wait 10 --resultformat human --codecoverage
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Salesforce CLI
uses: forcedotcom/sfdx-action@v1
with:
version: latest

- name: Authenticate to Dev Hub
run: sfdx auth:jwt:grant --clientid ${{ secrets.SF_CLIENT_ID }} --jwtkeyfile assets/server.key --username ${{ secrets.SF_DEV_HUB_USERNAME }} --instanceurl https://login.salesforce.com --setdefaultdevhubusername

- name: Create Scratch Org
run: sfdx force:org:create -s -f config/project-scratch-def.json -a MyScratchOrg

- name: Push Source to Scratch Org
run: sfdx force:source:push -u MyScratchOrg

- name: Run Apex Tests
run: sfdx force:apex:test:run -u MyScratchOrg --wait 10 --resultformat human --codecoverage

0 comments on commit 551b90a

Please sign in to comment.