Skip to content

--amend

--amend #41

Workflow file for this run

name: code-coverage
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: |
sudo npm install -g sfdx-cli
- 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'
- name: Delete Existing Scratch Orgs
run: |
sfdx force:org:list --json | jq -r '.result.scratchOrgs[] | select(.status == "Active") | .alias' | xargs -n 1 sfdx org delete scratch --target-org | -o ciorg
# - name: Create Scratch Org
# run: sfdx org create scratch --target-dev-hub devhub --definition-file config/project-scratch-def.json --alias ciorg --set-default
- name: Create Scratch Org
run: sfdx org create scratch -f config/project-scratch-def.json -a ciorg -s -d 1
- name: Deploy source
run: sfdx project deploy start -o ciorg --source-dir ./force-app
- name: Run Apex tests
run: sfdx force:apex:test:run --codecoverage --resultformat human -d ./ -o ciorg
- name: Upload code coverage for Apex to Codecov.io
uses: codecov/codecov-action@v2
with:
flags: Apex
- name: Delete Scratch Org
if: always()
run: sfdx org delete scratch --target-org | -o ciorg --no-prompt | -p