Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github/workflows: simplify npm cache setup #3404

Merged
merged 1 commit into from Dec 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
81 changes: 13 additions & 68 deletions .github/workflows/ci.yml
Expand Up @@ -13,16 +13,9 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-

- name: Install Dependencies
run: npm ci

Expand Down Expand Up @@ -65,16 +58,17 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Run npm install
run: npm install --package-lock-only --engine-strict --strict-peer-deps
run: npm install --engine-strict --strict-peer-deps

- name: Check that package-lock.json is in sync with package.json
run: git diff --exit-code package-lock.json

- name: Check that package-lock.json doesn't have conflicts
run: npm ls --package-lock-only --depth 999
run: npm ls --depth 999

integrationTests:
name: Run integration tests
Expand All @@ -87,9 +81,9 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}
# We install bunch of packages during integration tests without locking them
# so we skip cache action to not pollute cache for other jobs.

# We install bunch of packages during integration tests without locking them
# so we skip cache action to not pollute cache for other jobs.
- name: Install Dependencies
run: npm ci

Expand All @@ -106,16 +100,9 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-

- name: Install Dependencies
run: npm ci

Expand All @@ -132,16 +119,9 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-

- name: Install Dependencies
run: npm ci

Expand All @@ -168,16 +148,9 @@ jobs:
- name: Setup Node.js v${{ matrix.node_version_to_setup }}
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ matrix.node_version_to_setup }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-

- name: Install Dependencies
run: npm ci

Expand All @@ -196,16 +169,9 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-

- name: Install Dependencies
run: npm ci

Expand All @@ -224,16 +190,9 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-

- name: Install Dependencies
run: npm ci

Expand Down Expand Up @@ -264,16 +223,9 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-

- name: Install Dependencies
run: npm ci

Expand All @@ -300,16 +252,9 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: npm
node-version: ${{ env.NODE_VERSION_USED_FOR_DEVELOPMENT }}

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-

- name: Install Dependencies
run: npm ci

Expand Down