This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
[Snyk] Upgrade @vuelidate/validators from 2.0.0 to 2.0.4 #2676
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
name: Deploy PR Preview on Storefrontcloud | |
env: | |
PWA_HOST: https://shopware-pwa-canary.storefrontcloud.io | |
INSTANCE_CODE: shopware-pwa-test-europe-west1-gcp-storefrontcloud-io | |
EXPERIMENTAL_IMAGE_PROCESSING_SERVER: https://test-shopware-pwa-images.vercel.app/api/image | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
paths-ignore: | |
- "*.md" | |
- ".github/**" | |
- "docs/**" | |
jobs: | |
init: | |
name: Init dependencies | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [14, 16] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Cache node_modules | |
uses: actions/cache@v2 | |
id: step-cache-node-modules | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Install dependencies | |
if: steps.step-cache-node-modules.outputs.cache-hit != 'true' | |
run: | | |
yarn --frozen-lockfile | |
build-cli: | |
name: Build CLI | |
needs: init | |
runs-on: ubuntu-latest | |
outputs: | |
package-hash: ${{ steps.folder-hash-step-cli.outputs.hash }} | |
strategy: | |
matrix: | |
node: [14, 16] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Check hash for directory packages/cli | |
id: folder-hash-step-cli | |
run: | | |
HASH=$(git rev-parse HEAD:packages/cli) | |
echo "::set-output name=hash::$HASH" | |
echo "Hash is: $HASH" | |
- name: Cache cli build | |
id: step-cache-build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-cli-build | |
with: | |
path: | | |
packages/cli/build | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ steps.folder-hash-step-cli.outputs.hash }} | |
- name: Cache node_modules | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Build CLI | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
run: | | |
cd ./packages/cli/ | |
yarn build | |
build-composables: | |
name: Build composables package | |
needs: init | |
runs-on: ubuntu-latest | |
outputs: | |
package-hash: ${{ steps.folder-hash-step-composables.outputs.hash }} | |
strategy: | |
matrix: | |
node: [14, 16] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Check hash for directory packages/composables | |
id: folder-hash-step-composables | |
run: | | |
HASH=$(git rev-parse HEAD:packages/composables) | |
echo "::set-output name=hash::$HASH" | |
echo "Hash is: $HASH" | |
- name: Cache composables build | |
id: step-cache-build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-composables-build | |
with: | |
path: | | |
packages/composables/dist | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ steps.folder-hash-step-composables.outputs.hash }} | |
- name: Cache node_modules | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Build Composables | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
run: | | |
yarn build composables --ci | |
build-helpers: | |
name: Build helpers package | |
needs: init | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [14, 16] | |
outputs: | |
package-hash: ${{ steps.folder-hash-step-helpers.outputs.hash }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Check hash for directory packages/helpers | |
id: folder-hash-step-helpers | |
run: | | |
HASH=$(git rev-parse HEAD:packages/helpers) | |
echo "::set-output name=hash::$HASH" | |
echo "Hash is: $HASH" | |
- name: Cache helpers build | |
id: step-cache-build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-helpers-build | |
with: | |
path: | | |
packages/helpers/dist | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ steps.folder-hash-step-helpers.outputs.hash }} | |
- name: Cache node_modules | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Build helpers | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
run: | | |
yarn build helpers --ci | |
build-nuxt-module: | |
name: Build nuxt-module package | |
needs: init | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [14, 16] | |
outputs: | |
package-hash: ${{ steps.folder-hash-step-nuxt-module.outputs.hash }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Check hash for directory packages/nuxt-module | |
id: folder-hash-step-nuxt-module | |
run: | | |
HASH=$(git rev-parse HEAD:packages/nuxt-module) | |
echo "::set-output name=hash::$HASH" | |
echo "Hash is: $HASH" | |
- name: Cache nuxt-module build | |
id: step-cache-build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-nuxt-module-build | |
with: | |
path: | | |
packages/nuxt-module/dist | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ steps.folder-hash-step-nuxt-module.outputs.hash }} | |
- name: Cache node_modules | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Build nuxt-module | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
run: | | |
yarn build nuxt-module --ci | |
build-shopware-6-client: | |
name: Build shopware-6-client package | |
needs: init | |
runs-on: ubuntu-latest | |
outputs: | |
package-hash: ${{ steps.folder-hash-step-shopware-6-client.outputs.hash }} | |
strategy: | |
matrix: | |
node: [14, 16] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Check hash for directory packages/shopware-6-client | |
id: folder-hash-step-shopware-6-client | |
run: | | |
HASH=$(git rev-parse HEAD:packages/shopware-6-client) | |
echo "::set-output name=hash::$HASH" | |
echo "Hash is: $HASH" | |
- name: Cache shopware-6-client build | |
id: step-cache-build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-shopware-6-client-build | |
with: | |
path: | | |
packages/shopware-6-client/dist | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ steps.folder-hash-step-shopware-6-client.outputs.hash }} | |
- name: Cache node_modules | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Build shopware-6-client | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
run: | | |
yarn build shopware-6-client --ci | |
build-default-theme: | |
name: Build default-theme package | |
needs: init | |
runs-on: ubuntu-latest | |
outputs: | |
package-hash: ${{ steps.folder-hash-step-default-theme.outputs.hash }} | |
strategy: | |
matrix: | |
node: [14, 16] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Check hash for directory packages/default-theme | |
id: folder-hash-step-default-theme | |
run: | | |
HASH=$(git rev-parse HEAD:packages/default-theme) | |
echo "::set-output name=hash::$HASH" | |
echo "Hash is: $HASH" | |
- name: Cache default-theme build | |
id: step-cache-build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-default-theme-build | |
with: | |
path: | | |
packages/default-theme/dist | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ steps.folder-hash-step-default-theme.outputs.hash }} | |
- name: Cache node_modules | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Build default-theme | |
if: steps.step-cache-build.outputs.cache-hit != 'true' | |
run: | | |
node scripts/linkDependencies.js && yarn lerna link | |
yarn build default-theme --ci | |
create-test-project: | |
name: Create test project | |
needs: | |
[ | |
build-cli, | |
build-composables, | |
build-helpers, | |
build-nuxt-module, | |
build-shopware-6-client, | |
build-default-theme, | |
] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [14, 16] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Cache cli build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-cli-build | |
with: | |
path: | | |
packages/cli/build | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ needs.build-cli.outputs.package-hash }} | |
- name: Cache composables build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-composables-build | |
with: | |
path: | | |
packages/composables/dist | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ needs.build-composables.outputs.package-hash }} | |
- name: Cache helpers build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-helpers-build | |
with: | |
path: | | |
packages/helpers/dist | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ needs.build-helpers.outputs.package-hash }} | |
- name: Cache nuxt-module build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-nuxt-module-build | |
with: | |
path: | | |
packages/nuxt-module/dist | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ needs.build-nuxt-module.outputs.package-hash }} | |
- name: Cache shopware-6-client build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-shopware-6-client-build | |
with: | |
path: | | |
packages/shopware-6-client/dist | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ needs.build-shopware-6-client.outputs.package-hash }} | |
- name: Cache default-theme build | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-default-theme-build | |
with: | |
path: | | |
packages/default-theme/dist | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ needs.build-default-theme.outputs.package-hash }} | |
# Step to speed up project init | |
- name: Cache node_modules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-test | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
- name: Link packages | |
run: | | |
node ./scripts/linkDependencies.js | |
# Step to speed up project init | |
- name: Cache test-project | |
uses: actions/cache@v2 | |
env: | |
cache-name: test-cache-test-project | |
with: | |
path: | | |
test-project | |
!test-project/.shopware-pwa | |
!test-project/.yalc | |
!test-project/.yalc.lock | |
key: ${{ matrix.node }}-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}-${{ needs.build-cli.outputs.package-hash }} | |
- name: Create a project | |
run: | | |
mkdir -p test-project | |
cd ./test-project | |
../packages/cli/bin/shopware-pwa init --username=${{ secrets.SHOPWARE_ADMIN_USER }} --password=${{ secrets.SHOPWARE_ADMIN_PASSWORD }} --shopwareDomainsAllowList=${{ env.PWA_HOST }} --ci --devMode --stage local | |
- name: Build test project | |
run: | | |
yarn | |
node ./scripts/yalcPushPackages.js | |
node ./scripts/yalcLinkTestProject.js | |
cd ./test-project | |
yarn | |
yarn build | |
- name: Login to DockerHub | |
if: matrix.node == 16 | |
uses: docker/[email protected] | |
with: | |
registry: registry.storefrontcloud.io | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push Docker image | |
if: matrix.node == 16 | |
uses: docker/[email protected] | |
with: | |
context: ./test-project | |
push: true | |
labels: preview | |
tags: registry.storefrontcloud.io/shopware-pwa-storefrontcloud-io/vue-storefront:${{ github.sha }} | |
- name: Add information about PR from forked repo | |
if: github.repository_owner != 'vuestorefront' | |
uses: mshick/add-pr-comment@v1 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
allow-repeats: false | |
message: | | |
:warning: This PR comes from forked repository and cannot be deployed on our preview instance! | |
Nevertheless, thank you, we are going to see it in action locally first 👍 | |
deploy: | |
runs-on: ubuntu-latest | |
needs: create-test-project | |
steps: | |
- uses: chrnorm/deployment-action@releases/v1 | |
name: Create GitHub deployment | |
id: deployment | |
with: | |
token: "${{ github.token }}" | |
environment: preview | |
initial_status: in_progress | |
- name: Deploy on Storefrontcloud.io | |
id: deploy | |
uses: StorefrontCloud/[email protected] | |
if: github.repository_owner == 'vuestorefront' | |
with: | |
token: "${{ github.token }}" | |
namespace: "${{env.INSTANCE_CODE}}" | |
username: "${{ secrets.DOCKER_USERNAME }}" | |
password: "${{ secrets.DOCKER_PASSWORD }}" | |
- name: Comment PR | |
if: success() | |
uses: StorefrontCloud/storefrontcloud-comment-pr-preview-deploy@master | |
with: | |
preview_url: "${{ steps.deploy.outputs.preview_url }}" | |
token: "${{ github.token }}" | |
namespace: "${{env.INSTANCE_CODE}}" | |
- name: Update deployment status (success) | |
if: success() | |
uses: chrnorm/deployment-status@releases/v1 | |
with: | |
token: "${{ github.token }}" | |
target-url: ${{ steps.deploy.outputs.preview_url }} | |
state: "success" | |
description: Congratulations! The deploy is done. | |
deployment_id: ${{ steps.deployment.outputs.deployment_id }} | |
- name: Update deployment status (failure) | |
if: failure() | |
uses: chrnorm/deployment-status@releases/v1 | |
with: | |
token: "${{ github.token }}" | |
description: Unfortunately, the instance hasn't been updated. | |
state: "failure" | |
deployment_id: ${{ steps.deployment.outputs.deployment_id }} |