-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@W-14913383 | Fix e2e pipeline #302
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
name: e2e-tests | ||
|
||
on: | ||
pull_request: | ||
branches: [ develop ] | ||
pull_request: | ||
branches: [develop] | ||
|
||
jobs: | ||
e2e-test: | ||
runs-on: ubuntu-latest | ||
env: | ||
DEVHUB_USERNAME: ${{ secrets.DEVHUB_USERNAME }} | ||
DEVHUB_AUTH: ${{ secrets.DEVHUB_AUTH }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node (v20) | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
- name: Setup SF and yarn | ||
run: | | ||
echo 'y' | npm install @salesforce/cli --global | ||
npm install --global yarn | ||
sf --version | ||
echo 'y' | sf plugins install shane-sfdx-plugins | ||
- name: Build the plugin | ||
run: | | ||
yarn install && yarn build | ||
- name: Auth Devhub | ||
run: | | ||
echo ${{ env.DEVHUB_AUTH }} > authFile | ||
sf force auth sfdxurl store -f 'authFile' | ||
- name: Cleanup The Latest Scratch Org From This Pull Request | ||
run: | | ||
LAST_SCRATCH_ID=`sf data query --query "SELECT Id FROM ActiveScratchOrg WHERE SignupUsername LIKE '%pr${{ env.PR_NUMBER }}%'" -o ${{ env.DEVHUB_USERNAME }} --json | jq -r '.result.records[0].Id'` | ||
if [ "$LAST_SCRATCH_ID" != "null" ]; then sf data delete record -s ActiveScratchOrg -o ${{ env.DEVHUB_USERNAME }} -i $LAST_SCRATCH_ID; else echo 'No scratch org needs to be deleted.'; fi | ||
- name: Create Scratch Org | ||
id: scratch-org-step | ||
run: | | ||
export SCRATCH_ORG_ID=`date +%Y%m%d-%H%M%S` | ||
export SCRATCH_ORG_ALIAS="gworkflow-pr${{ env.PR_NUMBER }}-$SCRATCH_ORG_ID" | ||
export SCRATCH_ORG_USERNAME="$SCRATCH_ORG_ALIAS@scratch.com" | ||
|
||
./bin/run commerce:scratchorg:create -u "$SCRATCH_ORG_USERNAME" -a "$SCRATCH_ORG_ALIAS" -v ${{ env.DEVHUB_USERNAME }} -d 1 | ||
echo "USERNAME=$SCRATCH_ORG_USERNAME" >> "$GITHUB_OUTPUT" | ||
- name: Create B2C LWR Store | ||
env: | ||
SCRATCH_ORG_USERNAME: ${{ steps.scratch-org-step.outputs.USERNAME }} | ||
run: ./bin/run commerce:store:create -n b2cstore01 -b b2cbuyer@commerce.com -v ${{ env.DEVHUB_USERNAME }} -u ${{ env.SCRATCH_ORG_USERNAME }} --json | ||
|
||
- name: Create B2B LWR Store | ||
e2e-test: | ||
runs-on: ubuntu-latest | ||
env: | ||
SCRATCH_ORG_USERNAME: ${{ steps.scratch-org-step.outputs.USERNAME }} | ||
run: ./bin/run commerce:store:create -o b2b -n b2bstore01 -b b2bbuyer@commerce.com -v ${{ env.DEVHUB_USERNAME }} -u ${{ env.SCRATCH_ORG_USERNAME }} --json | ||
- name: Create B2B Aura Store | ||
env: | ||
SCRATCH_ORG_USERNAME: ${{ steps.scratch-org-step.outputs.USERNAME }} | ||
run: ./bin/run commerce:store:create -o b2b -t "B2B Commerce (Aura)" -n b2baurastore01 -b b2baurabuyer@commerce.com -v ${{ env.DEVHUB_USERNAME }} -u ${{ env.SCRATCH_ORG_USERNAME }} --json | ||
- name: Confirmation | ||
run: echo "All stores are created!" | ||
DEVHUB_USERNAME: ${{ secrets.DEVHUB_USERNAME }} | ||
DEVHUB_AUTH: ${{ secrets.DEVHUB_AUTH }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
steps: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. something is not correct in new formatting... did u use any linter or IDE to reformat? this new one has 8 spaces where as the old one had 4 spaces for indentation. I think u might consider moving back to 4 spaces for indentation |
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node (v20) | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
- name: Setup SF and yarn | ||
run: | | ||
echo 'y' | npm install @salesforce/cli --global | ||
npm install --global yarn | ||
sf --version | ||
echo 'y' | sf plugins install shane-sfdx-plugins | ||
- name: Build the plugin | ||
run: | | ||
yarn install && yarn build | ||
- name: Auth Devhub | ||
run: | | ||
echo '${{ env.DEVHUB_AUTH }}' > authFile | ||
sf force auth sfdxurl store -f authFile | ||
- name: Cleanup The Latest Scratch Org From This Pull Request | ||
run: | | ||
LAST_SCRATCH_ID=`sf data query --query "SELECT Id FROM ActiveScratchOrg WHERE SignupUsername LIKE '%pr${{ env.PR_NUMBER }}%'" -o ${{ env.DEVHUB_USERNAME }} --json | jq -r '.result.records[0].Id'` | ||
if [ "$LAST_SCRATCH_ID" != "null" ]; then sf data delete record -s ActiveScratchOrg -o ${{ env.DEVHUB_USERNAME }} -i $LAST_SCRATCH_ID; else echo 'No scratch org needs to be deleted.'; fi | ||
- name: Create Scratch Org | ||
id: scratch-org-step | ||
run: | | ||
export SCRATCH_ORG_ID=`date +%Y%m%d-%H%M%S` | ||
export SCRATCH_ORG_ALIAS="gworkflow-pr${{ env.PR_NUMBER }}-$SCRATCH_ORG_ID" | ||
export SCRATCH_ORG_USERNAME="$SCRATCH_ORG_ALIAS@scratch.com" | ||
|
||
./bin/run commerce:scratchorg:create -u "$SCRATCH_ORG_USERNAME" -a "$SCRATCH_ORG_ALIAS" -v ${{ env.DEVHUB_USERNAME }} -d 1 | ||
echo "USERNAME=$SCRATCH_ORG_USERNAME" >> "$GITHUB_OUTPUT" | ||
- name: Create B2C LWR Store | ||
env: | ||
SCRATCH_ORG_USERNAME: ${{ steps.scratch-org-step.outputs.USERNAME }} | ||
run: ./bin/run commerce:store:create -n b2cstore01 -b b2cbuyer@commerce.com -v ${{ env.DEVHUB_USERNAME }} -u ${{ env.SCRATCH_ORG_USERNAME }} --json | ||
|
||
- name: Create B2B LWR Store | ||
env: | ||
SCRATCH_ORG_USERNAME: ${{ steps.scratch-org-step.outputs.USERNAME }} | ||
run: ./bin/run commerce:store:create -o b2b -n b2bstore01 -b b2bbuyer@commerce.com -v ${{ env.DEVHUB_USERNAME }} -u ${{ env.SCRATCH_ORG_USERNAME }} --json | ||
- name: Create B2B Aura Store | ||
env: | ||
SCRATCH_ORG_USERNAME: ${{ steps.scratch-org-step.outputs.USERNAME }} | ||
run: ./bin/run commerce:store:create -o b2b -t "B2B Commerce (Aura)" -n b2baurastore01 -b b2baurabuyer@commerce.com -v ${{ env.DEVHUB_USERNAME }} -u ${{ env.SCRATCH_ORG_USERNAME }} --json | ||
- name: Confirmation | ||
run: echo "All stores are created!" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are so many changes due to formatting, can u describe the actual change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kalagarraj Sure, thank you for asking. In the step "Auth Devhub" I have just changed
to
this fixed the inconsistency happened in some PR's where the authFile was not read correctly.