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
56 changes: 12 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,18 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]

workflow_dispatch:

jobs:
deploy-to-scratch-and-run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Salesforce CLI with NPM
run: |
npm install @salesforce/cli --global

- name: Authorize with the dev hub
run: |
echo "${{ secrets.SFDX_AUTH_URL_DEVHUB }}" | sf org login sfdx-url --alias DevHub --set-default-dev-hub --sfdx-url-stdin > /dev/null 2>&1
echo "✓ Successfully authenticated with Dev Hub"

- name: Create scratch org
run: |
sf org create scratch --definition-file config/project-scratch-def.json --alias ScratchOrg --wait 30 --duration-days 1 --set-default > /dev/null 2>&1
echo "✓ Successfully created scratch org"

- name: Push source
run: sf project deploy start --target-org ScratchOrg --wait 30

- name: Run tests
run: sf apex run test --target-org ScratchOrg --code-coverage --result-format human --output-dir ./tests/apex --test-level RunLocalTests --wait 30

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: beyond-the-cloud-dev/dml-lib
flags: Apex

- name: Delete scratch org
if: always()
run: |
sf org delete scratch --target-org ScratchOrg --no-prompt > /dev/null 2>&1
echo "✓ Scratch org cleanup completed"
salesforce-ci:
uses: beyond-the-cloud-dev/cicd-template/.github/workflows/salesforce-ci.yml@main
with:
node-version: '20'
sf-cli-version: 'latest'
scratch-org-duration: 1
test-level: 'RunLocalTests'
upload-to-codecov: true
codecov-slug: ${{ github.repository }} # Automatically uses current repository
secrets:
SFDX_AUTH_URL_DEVHUB: ${{ secrets.SFDX_AUTH_URL_DEVHUB }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

The DML Lib provides functional constructs for DML statements in Apex.

DML Lib is part of [Apex Fluently](https://apexfluently.beyondthecloud.dev/), a suite of production-ready Salesforce libraries by Beyond the Cloud.
DML Lib is part of [Apex Fluently](https://apexfluently.beyondthecloud.dev/), a suite of production-ready Salesforce libraries by [Beyond the Cloud](https://blog.beyondthecloud.dev/blog).

For more details, please refer to the [documentation](https://dml.beyondthecloud.dev).

Expand Down
Loading