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

Ci update 2023 04 06 #428

Merged
merged 6 commits into from
Apr 29, 2023
Merged
Show file tree
Hide file tree
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
16 changes: 4 additions & 12 deletions .ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ echo "\
// limit stdout to xxx lines
SH_RUN_WITH_SCREENSHOT_TXT_MAX_LINES: 64
}, process.env),
stdio: [
"ignore", 1, 2
]
stdio: ["ignore", 1, 2]
}
).on("exit", resolve);
});
Expand Down Expand Up @@ -147,14 +145,8 @@ import moduleChildProcess from "child_process";
await new Promise(function (resolve) {
moduleChildProcess.spawn(
"sh",
[
"jslint_ci.sh", "shBrowserScreenshot", url
],
{
stdio: [
"ignore", 1, 2
]
}
["jslint_ci.sh", "shBrowserScreenshot", url],
{stdio: ["ignore", 1, 2]}
).on("exit", resolve);
});
}));
Expand Down Expand Up @@ -432,7 +424,7 @@ import moduleFs from "fs";
"type": "git",
"url": "https://github.com/jslint-org/jslint.git"
},
"version": "2023.1.29"
"version": "2022.4.1"
}, undefined, 4)
}
].map(async function ({
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- run: echo "$(date -u +'%F %TZ') - ${{ env.CI_WORKFLOW_NAME }}"
- run: echo "$(date -u +"%Y-%m-%d %TZ") - ${{ env.CI_WORKFLOW_NAME }}" # "
# disable autocrlf in windows
- run: git config --global core.autocrlf false
# https://github.com/actions/checkout
Expand All @@ -66,8 +66,8 @@ jobs:
# https://github.com/actions/setup-node
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}
node-version: ${{ matrix.node_version }}
# https://github.com/actions/cache
- uses: actions/cache@v3
with:
Expand Down
40 changes: 32 additions & 8 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: on-pull-request
on:
- pull_request
- workflow_dispatch
# shCiBase - start
jobs:
build:
runs-on: ${{ matrix.os }}


job1:
strategy:
matrix:
architecture:
Expand All @@ -21,19 +21,43 @@ jobs:
- macos-latest
- ubuntu-latest
- windows-latest
name: node . v${{ matrix.node_version }} . ${{ matrix.architecture }} . ${{ matrix.os }}
# base - .github/workflows/ci.yml - beg
env:
CI_MATRIX_NAME: >
node
v${{ matrix.node_version }}
${{ matrix.architecture }}
${{ matrix.os }}
CI_MATRIX_NAME_MAIN: "node v18 x64 ubuntu-latest"
CI_MATRIX_NODE_VERSION: v${{ matrix.node_version }}
CI_MATRIX_NODE_VERSION_MAIN: v18
CI_WORKFLOW_NAME: >
${{ github.workflow }}
- ${{ github.event_name }}
- ${{ github.event.inputs.workflow_dispatch_name }}
- ${{ github.ref_name }}
name: >
node
v${{ matrix.node_version }}
${{ matrix.architecture }}
${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- run: echo "$(date -u +"%Y-%m-%d %TZ") - ${{ env.CI_WORKFLOW_NAME }}" # "
# disable autocrlf in windows
- run: git config --global core.autocrlf false
# https://github.com/actions/checkout
- uses: actions/checkout@v3
# fetch jslint_ci.sh from trusted source
- run: |
git fetch origin alpha --depth=1
sh -c 'for FILE in .ci.sh .ci2.sh jslint_ci.sh myci2.sh; do
if [ -f "$FILE" ]; then git checkout origin/alpha "$FILE"; fi; done'
# https://github.com/actions/setup-node
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}
# fetch jslint_ci.sh from trusted source
- run: git fetch origin alpha && git checkout origin/alpha jslint_ci.sh
node-version: ${{ matrix.node_version }}
# run nodejs coverages and tests
- run: sh jslint_ci.sh shCiBase
# shCiBase - end
# base - .github/workflows/ci.yml - end
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"*
'*
*.[0123456789][0123456789]
*.egg-info
*.lock
*.log
*.pyc
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
- jslint - try to improve parser to be able to parse jquery.js without stopping.
- jslint - unify analysis of variable-assignment/function-parameters into one function

# v2022.4.1-beta
- ci - add custom-shell-ci hooks to script jslint_ci.sh:
shCiArtifactUploadCustom()
shCiBaseCustom()
shCiBaseCustom2()
shCiLintCustom()
shCiLintCustom2()
shCiNpmPublishCustom()
shCiPreCustom()
shCiPreCustom2()
- ci - housekeeping of ci-file jslint_ci.sh
- ci - update shell-function shGitCommitPushOrSquash() to be able to save to specified filename
- ci - remove little-used shell-function shCiBranchPromote()

# v2023.1.29
- ci - in windows-ci-env, alias node=node.exe instead of using winpty for pipes
- ci - bugfix - fix ci-shell-function shGithubFileUpload unable to upload new asset
Expand Down
41 changes: 24 additions & 17 deletions jslint.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ let jslint_charset_ascii = (
+ "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
+ "`abcdefghijklmnopqrstuvwxyz{|}~\u007f"
);
let jslint_edition = "v2023.1.29";
let jslint_edition = "v2022.4.1-beta";
let jslint_export; // The jslint object to be exported.
let jslint_fudge = 1; // Fudge starting line and starting
// ... column to 1.
Expand Down Expand Up @@ -11231,35 +11231,41 @@ function sentinel() {}
if ((
/^coverage-\d+?-\d+?-\d+?\.json$/
).test(file)) {
console.error("rm file " + coverageDir + file);
consoleError("rm file " + coverageDir + file);
await moduleFs.promises.unlink(coverageDir + file);
}
}));
exitCode = await new Promise(function (resolve) {
moduleChildProcess.spawn((
processArgv[0] === "npm"
moduleChildProcess.spawn(
(
processArgv[0] === "npm"

// If win32 environment, then replace program npm with npm.cmd.
// Coverage-hack - Ugly-hack to get test-coverage under both win32 and linux.

? process.platform.replace("win32", "npm.cmd").replace(
process.platform,
"npm"
)
: processArgv[0]
), processArgv.slice(1), {
env: Object.assign({}, process.env, {
NODE_V8_COVERAGE: coverageDir
}),
stdio: [
"ignore", 1, 2
]
}).on("exit", resolve);
? process.platform.replace("win32", "npm.cmd").replace(
process.platform,
"npm"
)
: processArgv[0]
),
processArgv.slice(1),
{
env: Object.assign({}, process.env, {
NODE_V8_COVERAGE: coverageDir
}),
stdio: ["ignore", 1, 2]
}
).on("exit", resolve);
});
consoleError(
`v8CoverageReportCreate - program exited with exitCode=${exitCode}`
);
}

// 2. Merge JSON v8-coverage-files in <coverageDir>.

consoleError("v8CoverageReportCreate - merging coverage files...");
v8CoverageObj = await moduleFs.promises.readdir(coverageDir);
v8CoverageObj = v8CoverageObj.filter(function (file) {
return (
Expand Down Expand Up @@ -11331,6 +11337,7 @@ function sentinel() {}

// 3. Create html-coverage-reports in <coverageDir>.

consoleError("v8CoverageReportCreate - creating html-coverage-report...");
fileDict = Object.create(null);
await Promise.all(v8CoverageObj.result.map(async function ({
functions,
Expand Down