switch to node 18, unpin netlify-cli, and workaround npm ci then being broken (#5180)

* switch to node 18

which is now LTS

* unpin `netlify-cli`

* use `npm-ci-please` to workaound `npm ci` being broken

fixes #5115

* set version using `npm version`

which will also update the version in the package-lock

* be selective about what goes in artifact

to speed things up

* use newer `npm-ci-please`

* fix setting version on netlify

* fix permission on script

* listen on all interfaces for sauce labs

because otherwise with node 18 the server is not reachable through the proxy for some reason
This commit is contained in:
Tom Jenkinson
2023-01-23 17:13:47 +00:00
committed by GitHub
parent f0fc76a700
commit 87c3a3538e
9 changed files with 16707 additions and 1468 deletions
-1
View File
@@ -15,4 +15,3 @@ jobs:
with:
repo-token: ${{ secrets.CI_GITHUB_TOKEN }}
allowed-actors: renovate[bot]
package-block-list: netlify-cli
+12 -10
View File
@@ -83,7 +83,7 @@ jobs:
- name: install
run: |
npm ci
npx -y npm-ci-please@^1.1.1
env:
CI: true
@@ -94,7 +94,7 @@ jobs:
- name: set version
run: |
node ./scripts/set-package-version.js
./scripts/set-package-version.sh
env:
CI: true
TAG: ${{ needs.config.outputs.tag }}
@@ -115,10 +115,12 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: build
# version number is set in package.json so need to include that
path: |
**
!**/[.]*/**
!**/node_modules/
package.json
package-lock.json
api-docs/**
dist/**
test_unit:
needs: build
@@ -150,7 +152,7 @@ jobs:
- name: install
run: |
npm ci
npx -y npm-ci-please@^1.1.1
env:
CI: true
@@ -191,7 +193,7 @@ jobs:
- name: install
run: |
npm ci
npx -y npm-ci-please@^1.1.1
env:
CI: true
@@ -291,7 +293,7 @@ jobs:
- name: install
run: |
npm ci
npx -y npm-ci-please@^1.1.1
env:
CI: true
@@ -353,7 +355,7 @@ jobs:
- name: install
run: |
npm ci
npx -y npm-ci-please@^1.1.1
env:
CI: true
@@ -435,7 +437,7 @@ jobs:
- name: install
run: |
npm ci
npx -y npm-ci-please@^1.1.1
env:
CI: true
+1 -1
View File
@@ -1 +1 @@
16
18
+16676 -1437
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -96,7 +96,7 @@
"markdown-styles": "3.2.0",
"micromatch": "4.0.5",
"mocha": "10.2.0",
"netlify-cli": "12.2.8",
"netlify-cli": "12.9.1",
"node-fetch": "3.3.0",
"prettier": "2.8.3",
"promise-polyfill": "8.2.3",
@@ -2,9 +2,7 @@
/* eslint-env node */
'use strict';
const fs = require('fs');
const versionParser = require('./version-parser.js');
const packageJson = require('../package.json');
const { isValidStableVersion, incrementPatch } = require('./version-parser.js');
const latestVersion = getLatestVersionTag();
@@ -75,11 +73,7 @@ try {
);
}
packageJson.version = newVersion;
fs.writeFileSync('./package.json', JSON.stringify(packageJson), {
encoding: 'utf8',
});
console.log('Set version: ' + newVersion);
console.log(newVersion);
} catch (e) {
console.error(e);
process.exit(1);
+2 -2
View File
@@ -6,8 +6,8 @@ if [[ $(git rev-parse --is-shallow-repository) = "true" ]]; then
git fetch --unshallow
fi
npm ci
node ./scripts/set-package-version.js
npx -y npm-ci-please@^1.1.1
./scripts/set-package-version.sh
npm run lint
npm run type-check
npm run build:ci
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
set -e
VERSION="$(node ./scripts/get-package-version.js)"
echo "Setting version to '$VERSION'"
npm version --git-tag-version false "$VERSION"
+8 -9
View File
@@ -59,14 +59,12 @@ if (browserConfig.platform) {
browserDescription += `, ${browserConfig.platform}`;
}
const hostname = useSauce ? 'localhost' : '127.0.0.1';
// Launch static server
HttpServer.createServer({
showDir: false,
autoIndex: false,
root: './',
}).listen(8000, hostname);
}).listen(8000, useSauce ? '0.0.0.0' : '127.0.0.1');
const wait = (ms) => new Promise((resolve) => global.setTimeout(resolve, ms));
const stringifyResult = (result) =>
@@ -549,14 +547,13 @@ describe(`testing hls.js playback in the browser on "${browserDescription}"`, fu
beforeEach(async function () {
try {
await retry(async () => {
const testPageExt = HlsjsLightBuild ? '-light' : '';
const testPageUrl = `http://localhost:8000/tests/functional/auto/index${testPageExt}.html`;
if (printDebugLogs) {
console.log('Loading test page...');
console.log(`Loading test page: ${testPageUrl}`);
}
try {
const testPageExt = HlsjsLightBuild ? '-light' : '';
await browser.get(
`http://${hostname}:8000/tests/functional/auto/index${testPageExt}.html`
);
await browser.get(testPageUrl);
} catch (e) {
throw new Error('failed to open test page');
}
@@ -586,7 +583,9 @@ describe(`testing hls.js playback in the browser on "${browserDescription}"`, fu
afterEach(async function () {
const failed = this.currentTest.isFailed();
if (printDebugLogs || failed) {
const logString = await browser.executeScript('return logString');
const logString = await browser.executeScript(
'return window.logString || "";'
);
console.log(logString);
if (failed && useSauce) {
browser.executeScript('sauce:job-result=failed');