-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use `cache: npm` of `actions/setup-node` instead of `actions/cache` - Install the old npm version only on Node.js 14 and Windows - Remove the useless `env.CI`, which is set by default
- Loading branch information
1 parent
66376c5
commit 50a268a
Showing
1 changed file
with
6 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,6 @@ on: | |
branches: | ||
- '**' | ||
|
||
env: | ||
CI: true | ||
|
||
jobs: | ||
test: | ||
name: Test for Stylelint ${{ matrix.stylelint }} on Node.js ${{ matrix.node-version }} and ${{ matrix.os }} | ||
|
@@ -36,25 +33,15 @@ jobs: | |
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: npm | ||
|
||
- name: Get npm cache directory | ||
id: npm-cache-dir | ||
run: | | ||
echo "::set-output name=dir::$(npm config get cache)" | ||
- name: Cache npm cache | ||
uses: actions/cache@v3 | ||
id: npm-cache | ||
with: | ||
path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
# TODO: [email protected] is broken on Windows. See https://github.com/npm/cli/issues/4341 | ||
- name: Workaround for npm installation failure on Node.js 14 and Windows | ||
if: ${{ startsWith(matrix.node-version, '14') && runner.os == 'Windows' }} | ||
run: npm install --global [email protected] | ||
|
||
- name: Install latest npm | ||
run: npm install --global [email protected] | ||
# TODO: [email protected] is broken on Windows. See https://github.com/npm/cli/issues/4341 | ||
# run: npm install --global npm@latest | ||
run: npm install --global npm@latest | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|