Skip to content

Commit

Permalink
Clarify environment variables
Browse files Browse the repository at this point in the history
And also fixed the other `IS_DEFAULT_NPM` (the one for pwa-kit-windows).

Related to PR #1126
  • Loading branch information
vmarta committed Apr 12, 2023
1 parent a4700b2 commit 6944379
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ jobs:
env:
# The "default" npm is the one that ships with a given version of node.
# For more: https://nodejs.org/en/download/releases/
# (We also use this env var for making sure a step runs once for the current node version)
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 9) }}
IS_LATEST_NPM: ${{ matrix.node == 16 && matrix.npm == 8 }}
IS_MRT_NODE: ${{ matrix.node == 16 && matrix.npm == 8 }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -71,35 +72,35 @@ jobs:
uses: "./.github/actions/smoke_tests"

- name: Create MRT credentials file
if: env.IS_NOT_FORK == 'true' && env.IS_LATEST_NPM == 'true' && ( env.DEVELOP == 'true' || env.RELEASE == 'true' || env.V3 == 'true' )
if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && ( env.DEVELOP == 'true' || env.RELEASE == 'true' || env.V3 == 'true' )
uses: "./.github/actions/create_mrt"
with:
mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }}
mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }}

- name: Push Bundle to MRT (Development)
if: env.IS_NOT_FORK == 'true' && env.IS_LATEST_NPM == 'true' && env.DEVELOP == 'true'
if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.DEVELOP == 'true'
uses: "./.github/actions/push_to_mrt"
with:
CWD: "./packages/template-retail-react-app"
TARGET: staging

- name: Push Bundle to MRT (v3)
if: env.IS_NOT_FORK == 'true' && env.IS_LATEST_NPM == 'true' && env.V3 == 'true'
if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.V3 == 'true'
uses: "./.github/actions/push_to_mrt"
with:
CWD: "./packages/template-retail-react-app"
TARGET: staging-v3

- name: Push Bundle to MRT (Production)
if: env.IS_NOT_FORK == 'true' && env.IS_LATEST_NPM == 'true' && env.RELEASE == 'true'
if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.RELEASE == 'true'
uses: "./.github/actions/push_to_mrt"
with:
CWD: "./packages/template-retail-react-app"
TARGET: production

- name: Push Bundle to MRT (Commerce SDK React)
if: env.IS_NOT_FORK == 'true' && env.IS_LATEST_NPM == 'true' && env.DEVELOPMENT == 'true'
if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.DEVELOPMENT == 'true'
uses: "./.github/actions/push_to_mrt"
with:
CWD: "./packages/test-commerce-sdk-react"
Expand All @@ -110,7 +111,7 @@ jobs:
uses: "./.github/actions/check_clean"

- name: Publish to NPM
if: env.IS_NOT_FORK == 'true' && env.IS_LATEST_NPM == 'true' && env.RELEASE == 'true'
if: env.IS_NOT_FORK == 'true' && env.IS_MRT_NODE == 'true' && env.RELEASE == 'true'
uses: "./.github/actions/publish_to_npm"
with:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
Expand All @@ -135,7 +136,9 @@ jobs:
env:
# The "default" npm is the one that ships with a given version of node.
# For more: https://nodejs.org/en/download/releases/
IS_DEFAULT_NPM: ${{ matrix.node == 16 && matrix.npm == 8 || matrix.node == 18 && matrix.npm == 9 }}
# (We also use this env var for making sure a step runs once for the current node version)
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 9) }}
IS_MRT_NODE: ${{ matrix.node == 16 && matrix.npm == 8 }}
runs-on: windows-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -319,4 +322,4 @@ jobs:
uses: "./.github/actions/setup_ubuntu"

- name: Run Lighthouse CI on the PWA
uses: "./.github/actions/lighthouse_ci"
uses: "./.github/actions/lighthouse_ci"

0 comments on commit 6944379

Please sign in to comment.