From 831ded2afd5c6805c72638cbe83942713bcd89d1 Mon Sep 17 00:00:00 2001 From: tarcan-gul Date: Mon, 29 Jan 2024 11:37:55 -0500 Subject: [PATCH 1/3] Try without quotes --- .github/workflows/e2etest.yml | 110 +++++++++++++++++----------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/.github/workflows/e2etest.yml b/.github/workflows/e2etest.yml index fc28dc2..eab6343 100644 --- a/.github/workflows/e2etest.yml +++ b/.github/workflows/e2etest.yml @@ -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!" \ No newline at end of file + 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 + 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!" From 5f5efc64086f080232b2b40683445b0b10dce8a8 Mon Sep 17 00:00:00 2001 From: tarcan-gul Date: Wed, 31 Jan 2024 10:24:41 -0500 Subject: [PATCH 2/3] fix indent --- .github/workflows/e2etest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2etest.yml b/.github/workflows/e2etest.yml index eab6343..ecd066d 100644 --- a/.github/workflows/e2etest.yml +++ b/.github/workflows/e2etest.yml @@ -29,7 +29,7 @@ jobs: yarn install && yarn build - name: Auth Devhub run: | - echo '${{ env.DEVHUB_AUTH }}' > authFile + echo '${{ env.DEVHUB_AUTH }}' > authFile sf force auth sfdxurl store -f authFile - name: Cleanup The Latest Scratch Org From This Pull Request run: | From 75d2d08221d04e50c33c8c935e16497f4fb0be88 Mon Sep 17 00:00:00 2001 From: tarcan-gul Date: Wed, 31 Jan 2024 10:33:22 -0500 Subject: [PATCH 3/3] fix indent --- .github/workflows/e2etest.yml | 110 +++++++++++++++++----------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/.github/workflows/e2etest.yml b/.github/workflows/e2etest.yml index ecd066d..e5c73ad 100644 --- a/.github/workflows/e2etest.yml +++ b/.github/workflows/e2etest.yml @@ -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 + 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" - - 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!" + ./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!" \ No newline at end of file