Skip to content

Commit

Permalink
ci: Run tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lauriro committed Nov 13, 2021
1 parent b987284 commit a7e9f52
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 31 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/Test.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,38 @@
name: Test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
Test-on-Linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
cache: npm
cache-dependency-path: 'package.json'
- name: Install
run: npm install -g jshint c8 uglify-js
- name: Lint
run: jshint *.js cli/*.js
- name: Test
run: TZ=Europe/Tallinn npm run cov
- name: Upload to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Test-on-Windows:
runs-on: windows-latest
steps:
- name: Set timezone on Windows
run: tzutil /s "FLE Standard Time"
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Test
run: npm run win

2 changes: 1 addition & 1 deletion cli/build.js
Expand Up @@ -39,7 +39,7 @@ var key
}
, commands = {
css: cssMin,
js: "uglifyjs --warn --ie8 -c 'evaluate=false,properties=false' -m eval --comments '/^\\s*[@!]/' --beautify 'beautify=false,semicolons=false,keep_quoted_props=true'",
js: "uglifyjs --config-file " + path.resolve(module.filename, "../minify.json"),
//esbuild --minify --target=es5 load.js
json: function(attrs) {
return JSON.stringify(JSON.parse(attrs._j))
Expand Down
17 changes: 17 additions & 0 deletions cli/minify.json
@@ -0,0 +1,17 @@
{
"warnings": true,
"ie8": true,
"compress": {
"evaluate": false,
"properties": false
},
"mangle": {
"eval": true
},
"output": {
"comments": "/^\\s*[@!]/",
"beautify": false,
"semicolons": false,
"keep_quoted_props": true
}
}
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -25,14 +25,19 @@
"lj-stat": "./cli/stat",
"lj": "./index.js"
},
"scripts": {
"cov": "c8 -r lcov -r text-summary --check-coverage --branches=70 --functions=70 --lines=70 --statements=70 node -r ./test.js --allow-natives-syntax --expose-gc test/index.js --brief",
"test": "node -r ./test.js --allow-natives-syntax --expose-gc test/index.js --brief",
"win": "node -r ./test.js test/test.js --brief"
},
"litejs": {
"build": false,
"install": false,
"lint": [
"jshint *.js",
"jshint cli/*.js"
],
"test": "node -r ./test.js --allow-natives-syntax --expose-gc test/index.js --brief"
"test": "npm test"
},
"jshintConfig": {
"asi": true,
Expand Down
2 changes: 1 addition & 1 deletion test/bench.js
Expand Up @@ -14,7 +14,7 @@ describe("bench.js", function() {
var count = 5
retry()
function retry() {
bench({ a: nop, b: nop }, {warmup:10,samples:3,"sample-time":30}, function(err, result) {
bench({ a: nop, b: nop }, {warmup:20,samples:3,"sample-time":30}, function(err, result) {
if (result.a.rel !== result.b.rel && --count) return retry()
assert.equal(result.a.rel, "fastest")
assert.equal(result.b.rel, "fastest")
Expand Down

0 comments on commit a7e9f52

Please sign in to comment.