Skip to content

Interpreting query get expr #487

Interpreting query get expr

Interpreting query get expr #487

Workflow file for this run

name: PR Build
on:
pull_request:
branches: [ main ]
types: [ opened, reopened, synchronize, closed ]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: "20"
- name: Install dependencies
run: npm install
- name: Install Salesforce CLI
run: npm install @salesforce/cli --global
- name: Populate auth file with SFDX_URL secret
shell: bash
run: echo ${{ secrets.DEV_HUB_AUTH_URL}} > ./SFDX_URL_STORE.txt
- name: Authenticate against dev hub
run: sf org login sfdx-url --sfdx-url-file ./SFDX_URL_STORE.txt --alias=devhub --set-default-dev-hub
- name: Create scratch org
run: sf org create scratch --definition-file=config/dev.json --alias=scratch-org --set-default --duration-days=1
- name: Push source
run: sf project deploy start
- name: Run tests
run: sf apex run test --code-coverage --result-format json -w 30 > test-results.json
- name: Check code coverage
run: |
COVERAGE=$(jq -r '.result.summary.testRunCoverage' test-results.json)
COVERAGE=${COVERAGE%\%}
echo "Code coverage: $COVERAGE%"
if (( $(echo "$COVERAGE < 90" | bc -l) )); then
echo "Code coverage is less than 90%, failing the build."
exit 1
fi
- name: Clean up scratch org
run: sf org scratch delete --target-org=scratch-org --no-prompt