fix: test pnpm cache

This commit is contained in:
Dominik Pschenitschni 2022-04-09 22:24:16 +02:00
parent d76b526916
commit e5d04c98da
No known key found for this signature in database
GPG key ID: B257AC0149F43A77

View file

@ -20,63 +20,44 @@ services:
steps: steps:
# Disabled until we figure out why it is so slow # Disabled until we figure out why it is so slow
# - name: restore-cache - name: restore-cache
# image: meltwater/drone-cache:dev image: meltwater/drone-cache:dev
# pull: true pull: true
# environment: environment:
# AWS_ACCESS_KEY_ID: AWS_ACCESS_KEY_ID:
# from_secret: cache_aws_access_key_id from_secret: cache_aws_access_key_id
# AWS_SECRET_ACCESS_KEY: AWS_SECRET_ACCESS_KEY:
# from_secret: cache_aws_secret_access_key from_secret: cache_aws_secret_access_key
# settings: settings:
# restore: true debug: true
# bucket: kolaente.dev-drone-dependency-cache restore: true
# endpoint: https://s3.fr-par.scw.cloud bucket: kolaente.dev-drone-dependency-cache
# region: fr-par endpoint: https://s3.fr-par.scw.cloud
# path_style: true region: fr-par
# cache_key: '{{ .Repo.Name }}_{{ checksum "pnpm-lock.yaml" }}_{{ arch }}_{{ os }}' path_style: true
# mount: cache_key: '{{ .Repo.Name }}_{{ checksum "pnpm-lock.yaml" }}_{{ arch }}_{{ os }}'
# - '.cache' mount:
- .cache
- name: dependencies - name: dependencies
image: node:18-alpine image: node:18-alpine
pull: true pull: true
environment: environment:
PNPM_CACHE_FOLDER: .cache/pnpm/ PNPM_CACHE_FOLDER: .cache/pnpm
CYPRESS_CACHE_FOLDER: .cache/cypress/ CYPRESS_CACHE_FOLDER: .cache/cypress
commands: commands:
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/.pnpm - corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/pnpm
- pnpm install --fetch-timeout 100000 - pnpm install --fetch-timeout 100000
# depends_on: depends_on:
# - restore-cache - restore-cache
# - name: rebuild-cache
# image: meltwater/drone-cache:dev
# pull: true
# environment:
# AWS_ACCESS_KEY_ID:
# from_secret: cache_aws_access_key_id
# AWS_SECRET_ACCESS_KEY:
# from_secret: cache_aws_secret_access_key
# settings:
# rebuild: true
# bucket: kolaente.dev-drone-dependency-cache
# endpoint: https://s3.fr-par.scw.cloud
# region: fr-par
# path_style: true
# cache_key: '{{ .Repo.Name }}_{{ checksum "pnpm-lock.yaml" }}_{{ arch }}_{{ os }}'
# mount:
# - '.cache'
# depends_on:
# - dependencies
- name: lint - name: lint
image: node:18-alpine image: node:18-alpine
pull: true pull: true
environment: environment:
PNPM_CACHE_FOLDER: .cache/pnpm/ PNPM_CACHE_FOLDER: .cache/pnpm
commands: commands:
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/.pnpm - corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/pnpm
- pnpm run lint - pnpm run lint
depends_on: depends_on:
- dependencies - dependencies
@ -85,9 +66,9 @@ steps:
image: node:18-alpine image: node:18-alpine
pull: true pull: true
environment: environment:
PNPM_CACHE_FOLDER: .cache/pnpm/ PNPM_CACHE_FOLDER: .cache/pnpm
commands: commands:
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/.pnpm - corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/pnpm
- pnpm run build - pnpm run build
depends_on: depends_on:
- dependencies - dependencies
@ -96,7 +77,7 @@ steps:
image: node:18-alpine image: node:18-alpine
pull: true pull: true
commands: commands:
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/.pnpm - corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/pnpm
- pnpm run test:unit - pnpm run test:unit
depends_on: depends_on:
- dependencies - dependencies
@ -106,9 +87,9 @@ steps:
image: node:18-alpine image: node:18-alpine
pull: true pull: true
environment: environment:
PNPM_CACHE_FOLDER: .cache/pnpm/ PNPM_CACHE_FOLDER: .cache/pnpm
commands: commands:
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/.pnpm - corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/pnpm
- pnpm run typecheck - pnpm run typecheck
depends_on: depends_on:
- dependencies - dependencies
@ -119,19 +100,39 @@ steps:
environment: environment:
CYPRESS_API_URL: http://api:3456/api/v1 CYPRESS_API_URL: http://api:3456/api/v1
CYPRESS_TEST_SECRET: averyLongSecretToSe33dtheDB CYPRESS_TEST_SECRET: averyLongSecretToSe33dtheDB
PNPM_CACHE_FOLDER: .cache/pnpm/ PNPM_CACHE_FOLDER: .cache/pnpm
CYPRESS_CACHE_FOLDER: .cache/cypress/ CYPRESS_CACHE_FOLDER: .cache/cypress
CYPRESS_DEFAULT_COMMAND_TIMEOUT: 60000 CYPRESS_DEFAULT_COMMAND_TIMEOUT: 60000
CYPRESS_RECORD_KEY: CYPRESS_RECORD_KEY:
from_secret: cypress_project_key from_secret: cypress_project_key
commands: commands:
- sed -i 's/localhost/api/g' dist/index.html - sed -i 's/localhost/api/g' dist/index.html
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/.pnpm - corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/pnpm
- pnpm run serve:dist & npx wait-on http://localhost:4173 - pnpm run serve:dist & npx wait-on http://localhost:4173
- pnpm run test:frontend --browser chrome --record - pnpm run test:frontend --browser chrome --record
depends_on: depends_on:
- build-prod - build-prod
- name: rebuild-cache
image: meltwater/drone-cache:dev
pull: true
environment:
AWS_ACCESS_KEY_ID:
from_secret: cache_aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: cache_aws_secret_access_key
settings:
rebuild: true
bucket: kolaente.dev-drone-dependency-cache
endpoint: https://s3.fr-par.scw.cloud
region: fr-par
path_style: true
cache_key: '{{ .Repo.Name }}_{{ checksum "pnpm-lock.yaml" }}_{{ arch }}_{{ os }}'
mount:
- .cache
depends_on:
- dependencies
- name: deploy-preview - name: deploy-preview
image: node:18-alpine image: node:18-alpine
pull: true pull: true
@ -175,30 +176,30 @@ steps:
commands: commands:
- git fetch --tags - git fetch --tags
# - name: restore-cache - name: restore-cache
# image: meltwater/drone-cache:dev image: meltwater/drone-cache:dev
# pull: true pull: true
# environment: environment:
# AWS_ACCESS_KEY_ID: AWS_ACCESS_KEY_ID:
# from_secret: cache_aws_access_key_id from_secret: cache_aws_access_key_id
# AWS_SECRET_ACCESS_KEY: AWS_SECRET_ACCESS_KEY:
# from_secret: cache_aws_secret_access_key from_secret: cache_aws_secret_access_key
# settings: settings:
# restore: true restore: true
# bucket: kolaente.dev-drone-dependency-cache bucket: kolaente.dev-drone-dependency-cache
# endpoint: https://s3.fr-par.scw.cloud endpoint: https://s3.fr-par.scw.cloud
# region: fr-par region: fr-par
# path_style: true path_style: true
# cache_key: '{{ .Repo.Name }}_{{ checksum "pnpm-lock.yaml" }}_{{ arch }}_{{ os }}' cache_key: '{{ .Repo.Name }}_{{ checksum "pnpm-lock.yaml" }}_{{ arch }}_{{ os }}'
# mount: mount:
# - '.cache' - .cache
- name: build - name: build
image: node:18-alpine image: node:18-alpine
pull: true pull: true
group: build-static group: build-static
environment: environment:
PNPM_CACHE_FOLDER: .cache/pnpm/ PNPM_CACHE_FOLDER: .cache/pnpm
commands: commands:
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/.pnp - corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/.pnp
- pnpm install --fetch-timeout 100000 - pnpm install --fetch-timeout 100000
@ -206,8 +207,8 @@ steps:
- "echo '{\"VERSION\": \"'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'\"}' > src/version.json" - "echo '{\"VERSION\": \"'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'\"}' > src/version.json"
- pnpm run build - pnpm run build
- sed -i 's/http\:\\/\\/localhost\\:3456\\/api\\/v1/\\/api\\/v1/g' dist/index.html # Override the default api url used for developing - sed -i 's/http\:\\/\\/localhost\\:3456\\/api\\/v1/\\/api\\/v1/g' dist/index.html # Override the default api url used for developing
# depends_on: depends_on:
# - restore-cache - restore-cache
- name: static - name: static
image: kolaente/zip image: kolaente/zip
@ -251,39 +252,39 @@ steps:
commands: commands:
- git fetch --tags - git fetch --tags
# - name: restore-cache - name: restore-cache
# image: meltwater/drone-cache:dev image: meltwater/drone-cache:dev
# pull: true pull: true
# environment: environment:
# AWS_ACCESS_KEY_ID: AWS_ACCESS_KEY_ID:
# from_secret: cache_aws_access_key_id from_secret: cache_aws_access_key_id
# AWS_SECRET_ACCESS_KEY: AWS_SECRET_ACCESS_KEY:
# from_secret: cache_aws_secret_access_key from_secret: cache_aws_secret_access_key
# settings: settings:
# restore: true restore: true
# bucket: kolaente.dev-drone-dependency-cache bucket: kolaente.dev-drone-dependency-cache
# endpoint: https://s3.fr-par.scw.cloud endpoint: https://s3.fr-par.scw.cloud
# region: fr-par region: fr-par
# path_style: true path_style: true
# cache_key: '{{ .Repo.Name }}_{{ checksum "pnpm-lock.yaml" }}_{{ arch }}_{{ os }}' cache_key: '{{ .Repo.Name }}_{{ checksum "pnpm-lock.yaml" }}_{{ arch }}_{{ os }}'
# mount: mount:
# - '.cache' - .cache
- name: build - name: build
image: node:18-alpine image: node:18-alpine
pull: true pull: true
group: build-static group: build-static
environment: environment:
PNPM_CACHE_FOLDER: .cache/pnpm/ PNPM_CACHE_FOLDER: .cache/pnpm
commands: commands:
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/.pnpm - corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/pnpm
- pnpm install --fetch-timeout 100000 - pnpm install --fetch-timeout 100000
- pnpm run lint - pnpm run lint
- "echo '{\"VERSION\": \"'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'\"}' > src/version.json" - "echo '{\"VERSION\": \"'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'\"}' > src/version.json"
- pnpm run build - pnpm run build
- sed -i 's/http\:\\/\\/localhost\\:3456\\/api\\/v1/\\/api\\/v1/g' dist/index.html # Override the default api url used for developing - sed -i 's/http\:\\/\\/localhost\\:3456\\/api\\/v1/\\/api\\/v1/g' dist/index.html # Override the default api url used for developing
# depends_on: depends_on:
# - restore-cache - restore-cache
- name: static - name: static
image: kolaente/zip image: kolaente/zip