Skip to content

Can't access cached npm or pnpm from next job/step (step label: 'npm or pnpm work?') #67

@mannycolon

Description

@mannycolon

image

common:
  - assume-ops-services-platform-role: &assume-ops-services-platform-role
      role-arn: $CI_ROLE_ARN
  - node-cache: &node-cache
      id: node
      backend: s3
      key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum 'pnpm-lock.yaml' }}"
      restore-keys:
        - 'v1-cache-{{ id }}-{{ runner.os }}-'
        - 'v1-cache-{{ id }}-'
      # compress: true # Optional. Create tar.gz instead of .tar (Compressed) Defaults to `false`.
      # compress-program: gzip # Optional. Allows for custom compression backends - i.e. pigz. Defaults to `gzip`.
      s3:
        bucket: e2-dev-buildkite-cache
        # save-cache: true # Optional. Saves the cache on temp folder and keep between builds/jobs on the same machine.
      paths:
        - node_modules
        - .npm-cache
        - apps/**/node_modules

steps:
 - group: ':open-pull-request: PR Checks'
    if: build.branch != "main"
    steps:
      - label: ':broom: All the things!'
        key: 'pr-checks'
        plugins:
          - *permissions
          - aws-assume-role-with-web-identity: *assume-ops-services-platform-role
          - nienbo/cache#v2.4.15: *node-cache
        commands:
          - '.buildkite/scripts/slack-message-user.sh'
          - 'apk add --no-cache tar' # Required for cache plugin to work correctly
          - 'apk add --update npm'
          - 'npm install -g pnpm'
          - 'pnpm install  --no-prefer-frozen-lockfile'
          - 'pnpm exec nx affected -t prisma-generate ${NX_AFFECTED_PR_OPTS}'
          - 'pnpm exec nx affected -t lint ${NX_AFFECTED_PR_OPTS}'
          - 'pnpm exec nx affected -t test ${NX_AFFECTED_PR_OPTS}'
          - 'pnpm exec nx affected -t build ${NX_AFFECTED_PR_OPTS}'
          # TODO: Add step to check serverless package build
      - wait: ~
      - label: 'npm or pnpm work?'
        key: 'pr-checks2'
        plugins:
          - *permissions
          - aws-assume-role-with-web-identity: *assume-ops-services-platform-role
          - nienbo/cache#v2.4.15: *node-cache
        commands:
          - 'ls -a'
          - 'apk add --update npm'
          - 'pnpm list'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions