File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ workflow_dispatch :
10+
11+ jobs :
12+ deploy-to-scratch-and-run-tests :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v4
17+
18+ - name : Install Node.js
19+ uses : actions/setup-node@v4
20+ with :
21+ node-version : 20
22+
23+ - name : Install Salesforce CLI with NPM
24+ run : |
25+ npm install @salesforce/cli --global
26+
27+ - name : Authorize with the dev hub
28+ run : |
29+ echo "${{ secrets.SFDX_AUTH_URL_DEVHUB }}" | sf org login sfdx-url --alias DevHub --set-default-dev-hub --sfdx-url-stdin > /dev/null 2>&1
30+ echo "✓ Successfully authenticated with Dev Hub"
31+
32+ - name : Create scratch org
33+ run : |
34+ sf org create scratch --definition-file config/project-scratch-def.json --alias ScratchOrg --wait 30 --duration-days 1 --set-default > /dev/null 2>&1
35+ echo "✓ Successfully created scratch org"
36+
37+ - name : Push source
38+ run : sf project deploy start --target-org ScratchOrg --wait 30
39+
40+ - name : Run tests
41+ run : sf apex run test --target-org ScratchOrg --code-coverage --result-format human --output-dir ./tests/apex --test-level RunLocalTests --wait 30
42+
43+ - name : Upload coverage reports to Codecov
44+ uses : codecov/codecov-action@v5
45+ with :
46+ token : ${{ secrets.CODECOV_TOKEN }}
47+ slug : beyond-the-cloud-dev/async-lib
48+ flags : Apex
49+
50+ - name : Delete scratch org
51+ if : always()
52+ run : |
53+ sf org delete scratch --target-org ScratchOrg --no-prompt > /dev/null 2>&1
54+ echo "✓ Scratch org cleanup completed"
Original file line number Diff line number Diff line change 1111<a ><img alt =" API version " src =" https://img.shields.io/badge/api-v64.0-blue?style=for-the-badge " ></a >
1212<a href =" https://github.com/beyond-the-cloud-dev/async-lib/blob/main/LICENSE " ><img alt =" License " src =" https://img.shields.io/badge/license-mit-green?style=for-the-badge " ></a >
1313
14-
14+ [ ![ CI] ( https://github.com/beyond-the-cloud-dev/async-lib/actions/workflows/ci.yml/badge.svg?branch=main )] ( https://github.com/beyond-the-cloud-dev/async-lib/actions/workflows/ci.yml )
15+ [ ![ codecov] ( https://codecov.io/gh/beyond-the-cloud-dev/async-lib/branch/main/graph/badge.svg )] ( https://codecov.io/gh/beyond-the-cloud-dev/async-lib )
1516</div >
1617
1718---
You can’t perform that action at this time.
0 commit comments