Skip to content

Commit 318c61d

Browse files
Merge pull request #474 from apex-enterprise-patterns/devops/update-to-sfv2-commands
switched to `apex-enterprise-patterns/setup-sfdx@v2`
2 parents 74d1e04 + cda8c10 commit 318c61d

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

.github/workflows/deploy.and.test.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,28 @@ jobs:
1515
with:
1616
ref: ${{github.event.pull_request.head.ref}}
1717
repository: ${{github.event.pull_request.head.repo.full_name}}
18-
- name: Install SFDX CLI and authorize DevHub
19-
uses: apex-enterprise-patterns/setup-sfdx@v1 #We're using a fork of https://github.com/sfdx-actions/setup-sfdx for safety
18+
- name: Install SF CLI and authorize DevHub
19+
uses: apex-enterprise-patterns/setup-sfdx@v2 #We're using a fork of https://github.com/sfdx-actions/setup-sfdx for safety
2020
with:
2121
sfdx-auth-url: ${{ secrets.DEVHUB_SFDXURL }}
22-
- run: sfdx force:config:set defaultdevhubusername=SFDX-ENV -g #Even though the setup-sfdx action uses --setdefaultdevhubusername, it doesn't seem to stick since it uses --setdefaultusername so we brute force it here
23-
- run: echo y | sfdx plugins:install shane-sfdx-plugins
24-
- run: sfdx force:org:create -f config/project-scratch-def.json --setdefaultusername -d 1
25-
- run: sfdx shane:github:src:install -c -g apex-enterprise-patterns -r fflib-apex-mocks -p sfdx-source/apex-mocks
26-
- run: sfdx force:source:push
27-
- run: sfdx force:apex:test:run -w 5
28-
#Intentionally install the Sample Code after the core AEP Commons test pass succeeds so that we don't deploy anything in Sample Code
29-
#that could mask a test failure. A much more involved solution would've been to do a workflow_dispatch to the samplecode project.
30-
- run: sfdx shane:github:src:install -c -g apex-enterprise-patterns -r fflib-apex-common-samplecode -p sfdx-source/apex-common-samplecode
31-
- run: sfdx force:apex:test:run -w 5
22+
- name: Install the required plugins
23+
run: echo y | sf plugins install shane-sfdx-plugins
24+
- name: Setup the config parameters needed
25+
run: sf config set target-dev-hub SFDX-ENV --global #Even though the setup-sfdx action uses --setdefaultdevhubusername, it doesn't seem to stick since it uses --setdefaultusername so we brute force it here
26+
- name: Create the scratch org
27+
run: sf org create scratch --definition-file config/project-scratch-def.json --set-default --duration-days 1 --no-track-source
28+
- name: Install required dependency frameworks
29+
run: sf shane github src install --convert --githubuser apex-enterprise-patterns --repo fflib-apex-mocks --path sfdx-source/apex-mocks
30+
- name: Deploy and compile the codebase
31+
run: sf project deploy start
32+
- name: Run the core framework tests
33+
run: sf apex run test --wait 5
34+
# Intentionally install the Sample Code after the core AEP Commons test pass succeeds so that we don't deploy anything in Sample Code
35+
# that could mask a test failure. A much more involved solution would've been to do a workflow_dispatch to the samplecode project.
36+
- name: Install sample code project to verify with
37+
run: sf shane github src install --convert --githubuser apex-enterprise-patterns --repo fflib-apex-common-samplecode --path sfdx-source/apex-common-samplecode
38+
- name: Run the core framework tests and the sample code project tests
39+
run: sf apex run test --wait 5
3240
- name: Destroy scratch org
33-
run: sfdx force:org:delete -p
41+
run: sf org delete scratch --no-prompt
3442
if: always()
35-

0 commit comments

Comments
 (0)