Skip to content

Commit a6627bc

Browse files
committed
ci: always install using latest node
1 parent cf30d86 commit a6627bc

File tree

4 files changed

+94
-12
lines changed

4 files changed

+94
-12
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,20 @@ jobs:
2323

2424
steps:
2525
- uses: actions/checkout@v2
26-
- name: Use Node.js ${{ matrix.node-version }}
26+
- name: Installing with latest Node.js
2727
uses: actions/setup-node@v2
28+
if: "${{ matrix.node-version != '*' }}"
2829
with:
29-
node-version: ${{ matrix.node-version }}
30+
node-version: '*'
3031
check-latest: true
3132
- name: NPM Install
3233
run: npm ci
34+
- name: Switching to Node.js ${{ matrix.node-version }} to run tests
35+
uses: actions/setup-node@v2
36+
if: "${{ matrix.node-version != '*' }}"
37+
with:
38+
node-version: ${{ matrix.node-version }}
39+
check-latest: true
3340
- name: Linting
3441
run: npm run format:ci
3542
if: "${{ matrix.node-version == '*' }}"
@@ -52,14 +59,21 @@ jobs:
5259

5360
steps:
5461
- uses: actions/checkout@v2
55-
- name: Use Node.js ${{ matrix.node-version }}
62+
- name: Installing with latest Node.js
5663
uses: actions/setup-node@v2
64+
if: "${{ matrix.node-version != '*' }}"
5765
with:
58-
node-version: ${{ matrix.node-version }}
66+
node-version: '*'
5967
check-latest: true
6068
- name: NPM Install
6169
run: npm ci
6270
- name: Install Next.js Canary
6371
run: npm install -D next@canary --legacy-peer-deps
72+
- name: Switching to Node.js ${{ matrix.node-version }} to run tests
73+
uses: actions/setup-node@v2
74+
if: "${{ matrix.node-version != '*' }}"
75+
with:
76+
node-version: ${{ matrix.node-version }}
77+
check-latest: true
6478
- name: Run tests against next@canary
6579
run: npm test

demos/plugin-wrapper/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"test": "echo \"Error: no test specified\" && exit 1"
99
},
1010
"devDependencies": {
11-
"@netlify/plugin-nextjs": "*"
11+
"@netlify/plugin-nextjs": "*",
12+
"husky": "^7.0.4",
13+
"npm-run-all": "^4.1.5"
1214
}
13-
}
15+
}

package-lock.json

Lines changed: 67 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
"format:check:prettier": "cross-env-shell prettier --check $npm_package_config_prettier",
1616
"format:fix:prettier": "cross-env-shell prettier --write $npm_package_config_prettier",
1717
"build": "npm run -w @netlify/plugin-nextjs build",
18-
"postinstall": "npm run build",
19-
"test": "run-s build build:demo test:jest",
18+
"postinstall": "run-s build install-husky",
19+
"install-husky": "if-env CI=1 || husky install node_modules/@netlify/eslint-config-node/.husky",
20+
"test": "run-s build:demo test:jest",
2021
"test:jest": "jest",
2122
"test:jest:update": "jest --updateSnapshot",
2223
"test:update": "run-s build build:demo test:jest:update"
@@ -41,11 +42,11 @@
4142
"url": "https://github.com/netlify/netlify-plugin-nextjs/issues"
4243
},
4344
"homepage": "https://github.com/netlify/netlify-plugin-nextjs#readme",
44-
"dependencies": {},
4545
"devDependencies": {
4646
"@babel/core": "^7.15.8",
4747
"@babel/preset-env": "^7.15.8",
4848
"@babel/preset-typescript": "^7.16.0",
49+
"@delucis/if-env": "^1.1.2",
4950
"@netlify/build": "^26.5.2",
5051
"@netlify/eslint-config-node": "^5.1.8",
5152
"@testing-library/cypress": "^8.0.1",
@@ -93,4 +94,4 @@
9394
"demos/base-path",
9495
"demos/plugin-wrapper"
9596
]
96-
}
97+
}

0 commit comments

Comments
 (0)