Skip to content

Commit

Permalink
ci: use --prefer-offline over caching node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
jackw committed Nov 21, 2022
1 parent da6592f commit 934365e
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,13 @@ jobs:
- name: Cache node modules
uses: actions/cache@v3
with:
path: |
node_modules
packages/create-plugin/generated/node_modules
packages/create-plugin/generated/yarn.lock
key: yarn-deps-${{ hashFiles('yarn.lock') }}
path: packages/create-plugin/generated/yarn.lock
key: yarn-generated-lock-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-deps-${{ hashFiles('yarn.lock') }}
yarn-generated-lock-${{ hashFiles('yarn.lock') }}
- name: Install dependencies
run: yarn install --immutable
run: yarn install --immutable --prefer-offline
- name: Check types
run: yarn typecheck
- name: Lint
Expand All @@ -39,11 +36,11 @@ jobs:
run: yarn test:ci

- name: '@grafana/create-plugin - test an app plugin generation'
run: yarn workspace @grafana/create-plugin run generate-app && (cd ./packages/create-plugin/generated && yarn && yarn build && yarn lint)
run: yarn workspace @grafana/create-plugin run generate-app && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)
- name: '@grafana/create-plugin - test panel plugin generation'
run: yarn workspace @grafana/create-plugin run generate-panel && (cd ./packages/create-plugin/generated && yarn && yarn build && yarn lint)
run: yarn workspace @grafana/create-plugin run generate-panel && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)
- name: '@grafana/create-plugin - test datasource plugin generation'
run: yarn workspace @grafana/create-plugin run generate-datasource && (cd ./packages/create-plugin/generated && yarn && yarn build && yarn lint)
run: yarn workspace @grafana/create-plugin run generate-datasource && (cd ./packages/create-plugin/generated && yarn install --prefer-offline && yarn build && yarn lint)

- name: '@grafana/sign-plugin - build'
run: yarn workspace @grafana/sign-plugin run build
Expand Down Expand Up @@ -71,17 +68,10 @@ jobs:
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'

- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: yarn-deps-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-deps-${{ hashFiles('yarn.lock') }}
cache: 'yarn'

- name: Install dependencies
run: yarn install --immutable
run: yarn install --immutable --prefer-offline

- name: Build
run: yarn build
Expand Down

0 comments on commit 934365e

Please sign in to comment.