Skip to content

Commit

Permalink
CI: try test on Windows. (#147)
Browse files Browse the repository at this point in the history
* CI: try test on Windows.

* noalloc

* try newline

* more on tests

* Turn windows tests back off.
  • Loading branch information
cristianoc authored May 4, 2022
1 parent 19c74f5 commit 389dd68
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,23 @@ jobs:
include:
- os: macos-latest
prebuild:
build: eval $(opam env) && npm run build406 && npm test
build: eval $(opam env) && npm run build406
test: npm test
artifact-folder: darwin
- os: ubuntu-18.04
prebuild:
build: eval $(opam env) && npm run build406 && npm test
build: eval $(opam env) && npm run build406
test: npm test
artifact-folder: linux
- os: ubuntu-20.04
prebuild:
build: eval $(opam env) && dune build
test:
artifact-folder: linuxNotForReScript
- os: windows-latest
prebuild: cp src/dune.406 src/dune
build: "& $env:CYGWIN_ROOT\\bin\\ocaml-env exec -- dune build"
test:
artifact-folder: win32

runs-on: ${{matrix.os}}
Expand Down Expand Up @@ -66,9 +70,12 @@ jobs:
- name: Pre-build
run: ${{matrix.prebuild}}

- name: Build and test
- name: Build
run: ${{matrix.build}}

- name: Test
run: ${{matrix.test}}

# Also avoids artifacts upload permission loss:
# https://github.com/actions/upload-artifact/tree/ee69f02b3dfdecd58bb31b4d133da38ba6fe3700#permission-loss
- name: Compress files
Expand Down
23 changes: 23 additions & 0 deletions examples/deadcode/noalloc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const fs = require("fs");
const child_process = require("child_process");
const path = require("path");

const spawn = child_process.spawn;

const isWindows = /^win/i.test(process.platform);

const reanalyzeNativePath = path.join(
__dirname,
"../../_build/default/src/Reanalyze.exe"
);

const shell = isWindows ? true : false;

child_process.spawnSync(
reanalyzeNativePath,
["-ci", "-noalloc"],
{
stdio: ["inherit", "inherit"],
shell,
}
);
2 changes: 1 addition & 1 deletion examples/deadcode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"clean": "node ../clean_bsb.js",
"dce": "node ./dce.js >src/deadcode.txt",
"exception": "node ./exception.js >src/exception.txt",
"noalloc": "../../_build/default/src/Reanalyze.exe -ci -noalloc >src/noalloc.txt",
"noalloc": "node ./noalloc.js >src/noalloc.txt",
"analyze": "npm run dce && npm run exception && npm run noalloc"
},
"devDependencies": {
Expand Down

0 comments on commit 389dd68

Please sign in to comment.