Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
#- "README.md"
paths:
- "force-app/**"
- ".github/workflows/ci.yml"

# Jobs to be executed
jobs:
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,25 @@ jobs:
uses: actions/checkout@v3
- name: Install Dependencies
run: |
wget https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz
mkdir ~/sfdx
tar xJf sfdx-linux-x64.tar.xz -C ~/sfdx --strip-components 1
echo "$HOME/sfdx/bin" >> $GITHUB_PATH
~/sfdx/bin/sfdx version
npm install @salesforce/cli --global
sf --version
- name: Populate auth file
run: 'echo "${{ secrets.SALESFORCE_AUTH_URL }}" > ./SALESFORCE_AUTH_URL.txt'
- name: Authenticate Dev Hub
run: "sfdx force:auth:sfdxurl:store -f ./SALESFORCE_AUTH_URL.txt -a DevHub -d"
run: "sf org login sfdx-url --sfdx-url-file ./SALESFORCE_AUTH_URL.txt --alias DevHub --set-default-dev-hub"
- name: Create Scratch Org
run: sfdx force:org:create --setdefaultusername --definitionfile config/project-scratch-def.json --setalias ciorg --durationdays 1
run: sf force org create --setdefaultusername --definitionfile config/project-scratch-def.json --setalias ciorg --durationdays 1
- name: Deploy source
run: sfdx force:source:push
run: sf force source push
- name: assign permissions
run: sfdx force:user:permset:assign -n Duplicates_Handler
run: sf force user permset assign --perm-set-name Duplicates_Handler
- name: Run Apex tests
run: sfdx force:apex:test:run --codecoverage --resultformat human -d ./
run: sf apex run test --code-coverage --result-format human --output-dir ./
#- name: Delete coverage file (temporary fix)
# run: rm ./test-result-707*-codecoverage.json
- name: "Upload code coverage for Apex to Codecov.io"
uses: codecov/codecov-action@v3
with:
flags: Apex
- name: Delete Scratch Org
run: sfdx force:org:delete --noprompt
run: sf force org delete --no-prompt
21 changes: 9 additions & 12 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
types: [opened, edited, synchronize, reopened]
paths:
- "force-app/**"
- ".github/workflows/pr.yml"

# Jobs to be executed
jobs:
Expand Down Expand Up @@ -43,7 +44,6 @@ jobs:
- name: "Code formatting verification with Prettier"
run: npm run prettier:verify


scratch-org-test:
runs-on: ubuntu-latest
needs: format-lint-lwc-tests
Expand All @@ -69,11 +69,8 @@ jobs:
# Install Salesforce CLI
- name: "Install Salesforce CLI"
run: |
wget https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz
mkdir ~/sfdx
tar xJf sfdx-linux-x64.tar.xz -C ~/sfdx --strip-components 1
echo "$HOME/sfdx/bin" >> $GITHUB_PATH
~/sfdx/bin/sfdx version
npm install @salesforce/cli --global
sf --version

# Store secret for dev hub
- name: "Populate auth file with SALESFORCE_AUTH_URL secret"
Expand All @@ -88,23 +85,23 @@ jobs:

# Authenticate dev hub
- name: "Authenticate Dev Hub"
run: sfdx auth:sfdxurl:store -f ./SALESFORCE_AUTH_URL.txt -a devhub -d
run: sf org login sfdx-url --sfdx-url-file ./SALESFORCE_AUTH_URL.txt --alias devhub --set-default-dev-hub

# Create scratch org
- name: "Create scratch org"
run: sfdx force:org:create -f config/project-scratch-def.json -a scratch-org -s -d 1
run: sf org create scratch --definition-file config/project-scratch-def.json --alias scratch-org --set-default --duration-days 1

# Deploy source to scratch org
- name: "Push source to scratch org"
run: sfdx force:source:push
run: sf project deploy start

# Assign permissionset
- name: "Assign permissionset to default user"
run: sfdx force:user:permset:assign -n Duplicates_Handler
run: sf org assign permset --name Duplicates_Handler

# Run Apex tests in scratch org
- name: "Run Apex tests"
run: sfdx force:apex:test:run -c -r human -d ./tests/apex -w 20
run: sf apex run test --code-coverage --result-format human --output-dir ./tests/apex --wait 20

# Delete temporary test file that Codecov is unable to parse
- name: "Delete coverage file (temporary step)"
Expand All @@ -119,4 +116,4 @@ jobs:
# Housekeeping
- name: "Delete scratch org"
if: always()
run: sfdx force:org:delete -p -u scratch-org
run: sf org delete scratch --no-prompt --target-org scratch-org
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
- uses: google-github-actions/release-please-action@v3
with:
command: manifest
release-type: salesforce
release-type: sfdx
default-branch: main
7 changes: 5 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
{
"files": "sfdx-project.json",
"options": { "useTabs": false, "tabWidth": 2 }
}
]
},
{ "files": "*.yml", "options": { "parser": "yaml" } },
{ "files": ".prettierrc", "options": { "parser": "json" } }
],
"plugins": ["prettier-plugin-apex", "@prettier/plugin-xml"]
}
8 changes: 6 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/.sfdx": true
"**/.sfdx": true,
"**/.sf": true
},
"salesforcedx-vscode-core.retrieve-test-code-coverage": true,
"apexPMD.enableCache": true,
Expand All @@ -15,5 +16,8 @@
"apexPMD.runOnFileOpen": true,
"apexPMD.runOnFileSave": true,
"apexPMD.showErrors": true,
"salesforcedx-vscode-core.push-or-deploy-on-save.enabled": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.prettierPath": "node_modules/prettier/index.cjs",
//"prettier.prettierPath": "./packages/compiler/node_modules/prettier/index.cjs",
"salesforcedx-vscode-core.push-or-deploy-on-save.enabled": false
}
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
1. If you haven't already done so, authorize your hub org and provide it with an alias (**myhuborg** in the command below):

```
sfdx auth:web:login -d -a myhuborg
sf org login web --set-default-dev-hub --alias myhuborg
```

1. Clone the duplicatehandling repository:
Expand Down Expand Up @@ -64,7 +64,7 @@ That's it!
1. If you haven't already done so, authorize your hub org and provide it with an alias (**myhuborg** in the command below):

```
sfdx auth:web:login -d -a myhuborg
sf org login web --set-default-dev-hub --alias myhuborg
```

1. Clone the duplicatehandling repository:
Expand All @@ -77,25 +77,25 @@ That's it!
1. Create a scratch org and provide it with an alias (**duplicatehandling** in the command below):

```
sfdx force:org:create -f config/project-scratch-def.json --durationdays 10 -a duplicatehandling -s
sf org create scratch --definition-file config/project-scratch-def.json --durationdays 10 --alias duplicatehandling --set-default
```

1. Push the app to your scratch org:

```
sfdx force:source:push
sf project deploy start
```

1. Assign the **Duplicates Handler** permission set to the default user:

```
sfdx force:user:permset:assign -n Duplicates_Handler
sf org assign permset --name Duplicates_Handler
```

1. Open the scratch org:

```
sfdx force:org:open
sf org open
```

## Installing the App using a Developer Edition Org or a Trailhead Playground
Expand All @@ -115,23 +115,23 @@ Make sure to start from a brand-new environment to avoid conflicts with previous
1. Authorize your Trailhead Playground or Developer org and provide it with an alias (**mydevorg** in the command below):

```
sfdx auth:web:login -s -a mydevorg
sf org login web --set-default-dev-hub --alias mydevorg
```

1. Run this command in a terminal to deploy the app.

```
sfdx force:source:deploy -p force-app
sf project deploy start --source-dir force-app
```

1. Assign the `Duplicates_Handler` permission set to the default user.

```
sfdx force:user:permset:assign -n Duplicates_Handler
sf org assign permset --name Duplicates_Handler
```

1. If your org isn't already open, open it now:

```
sfdx force:org:open -u mydevorg
sf org open --target-org mydevorg
```
Loading