Skip to content

Commit

Permalink
chore(ci): add validation deployment and apex test execution (#85)
Browse files Browse the repository at this point in the history
* chore(ci): install salesforce cli and perform org login

* chore(ci): deploy metadata to authenticated org

* chore(ci): run apex unit tests

* chore(ci): include apex test coverage results in sonar scan
  • Loading branch information
svierk authored Mar 4, 2024
1 parent 6f849a2 commit 1a95f55
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ jobs:
run: npm run lint:sonar
- name: LWC Unit Tests
run: npm run test:unit:coverage
- name: Install SF CLI
run: |
npm i -g @salesforce/cli
sf version
- name: Salesforce Org Login
run: sf org login sfdx-url --set-default --sfdx-url-file <(echo "${{ secrets.SFDX_AUTH_URL }}")
- name: Deploy Metadata
run: sf project deploy start
- name: Apex Unit Tests
run: sf apex run test --test-level=RunLocalTests --code-coverage --result-format=human -w 30 -d ./tests/apex --detailed-coverage
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
Expand Down
3 changes: 2 additions & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ sonar.exclusions=docs/**
sonar.test.inclusions=**/*test.js
sonar.coverage.exclusions=**/aura/**/*.js,jest-sa11y-setup.js,jest.config.js,**/test/**/*.js,**/*.cls,**/docs/**/*.js
sonar.javascript.lcov.reportPaths=./coverage/lcov.info
sonar.eslint.reportPaths=./eslint-report.json
sonar.eslint.reportPaths=./eslint-report.json
sonar.apex.coverage.reportPath=./tests/apex/test-result-codecoverage.json

0 comments on commit 1a95f55

Please sign in to comment.