Skip to content

Commit ff35139

Browse files
committed
Set up CI with Azure Pipelines.
1 parent 6dd2ec3 commit ff35139

File tree

6 files changed

+172
-109
lines changed

6 files changed

+172
-109
lines changed

4061.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

azure-pipelines.yml

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Node.js
2+
# Build a general Node.js project with npm.
3+
# Add steps that analyze code, save build artifacts, deploy, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
5+
6+
trigger:
7+
- master
8+
9+
jobs:
10+
- job: Linux
11+
pool:
12+
vmImage: ubuntu-16.04
13+
14+
steps:
15+
- task: NodeTool@0
16+
inputs:
17+
versionSpec: "10.x"
18+
displayName: "Install Node.js"
19+
20+
- bash: |
21+
BS_TRAVIS_CI=1
22+
OCAMLRUNPARAM="b"
23+
echo "##vso[task.setvariable variable=BS_TRAVIS_CI]$BS_TRAVIS_CI"
24+
echo "##vso[task.setvariable variable=OCAMLRUNPARAM]$OCAMLRUNPARAM"
25+
displayName: "Set BS_TRAVIS_CI and OCAMLRUNPARAM"
26+
27+
- bash: env
28+
displayName: "Print environment"
29+
30+
- script: |
31+
git submodule init
32+
git submodule update
33+
displayName: "Pull Submodules"
34+
35+
- script: |
36+
npm install
37+
displayName: "npm install"
38+
39+
- bash: |
40+
export BS_TRAVIS_CI=1
41+
npm test
42+
displayName: "test"
43+
44+
- job: macOS
45+
pool:
46+
vmImage: macOS-10.13
47+
48+
steps:
49+
- task: NodeTool@0
50+
inputs:
51+
versionSpec: "10.x"
52+
displayName: "Install Node.js"
53+
54+
- bash: |
55+
BS_TRAVIS_CI=1
56+
OCAMLRUNPARAM="b"
57+
echo "##vso[task.setvariable variable=BS_TRAVIS_CI]$BS_TRAVIS_CI"
58+
echo "##vso[task.setvariable variable=OCAMLRUNPARAM]$OCAMLRUNPARAM"
59+
displayName: "Set BS_TRAVIS_CI and OCAMLRUNPARAM"
60+
61+
- bash: env
62+
displayName: "Print environment"
63+
64+
- script: |
65+
git submodule init
66+
git submodule update
67+
displayName: "Pull Submodules"
68+
69+
- script: |
70+
npm install
71+
displayName: "npm install"
72+
73+
- bash: |
74+
export BS_TRAVIS_CI=1
75+
npm test
76+
displayName: "test"
77+
78+
- job: Windows
79+
pool:
80+
vmImage: vs2017-win2016
81+
82+
steps:
83+
- bash: |
84+
echo "which x86_64-w64-mingw32-gcc"
85+
which x86_64-w64-mingw32-gcc
86+
"echo ls -l /c/ProgramData/Chocolatey/bin"
87+
ls -l /c/ProgramData/Chocolatey/bin
88+
echo "int main() { return 0; }" >test.c
89+
echo "x86_64-w64-mingw32-gcc -v test.c"
90+
x86_64-w64-mingw32-gcc -v test.c
91+
# echo "esy b which x86_64-w64-mingw32-as"
92+
# esy b which x86_64-w64-mingw32-as
93+
94+
displayName: "find mingw"
95+
96+
- task: NodeTool@0
97+
inputs:
98+
versionSpec: "10.x"
99+
displayName: "Install Node.js"
100+
101+
- bash: |
102+
BS_TRAVIS_CI=1
103+
OCAMLRUNPARAM="b"
104+
echo "##vso[task.setvariable variable=BS_TRAVIS_CI]$BS_TRAVIS_CI"
105+
echo "##vso[task.setvariable variable=OCAMLRUNPARAM]$OCAMLRUNPARAM"
106+
displayName: "Set BS_TRAVIS_CI and OCAMLRUNPARAM"
107+
108+
- bash: env
109+
displayName: "Print environment"
110+
111+
- script: |
112+
git submodule init
113+
git submodule update
114+
displayName: "Pull Submodules"
115+
116+
- script: npm install -g esy
117+
displayName: "install esy"
118+
- script: esy install
119+
displayName: "esy install"
120+
- script: esy build
121+
displayName: "esy build"
122+
123+
- bash: |
124+
OCAMLOPT=`esy b which ocamlopt`
125+
OCAMLBIN_UNIX=$(dirname "${OCAMLOPT}")
126+
OCAMLBIN=$( cygpath --windows "$OCAMLBIN_UNIX")
127+
echo "OCAMLBIN: $OCAMLBIN"
128+
echo "##vso[task.setvariable variable=OCAMLBIN]$OCAMLBIN"
129+
echo "##vso[task.prependpath]$OCAMLBIN"
130+
displayName: "Set OCAMLBIN"
131+
132+
- bash: env
133+
displayName: "Print environment"
134+
135+
# - bash: ls -lR "$OCAMLBIN"
136+
# displayName: "ls -lR $OCAMLBIN"
137+
138+
# - bash: ls -lR "$OCAMLBIN/.."
139+
# displayName: "ls -lR $OCAMLBIN/.."
140+
141+
- bash: |
142+
echo "PATH"
143+
echo $PATH
144+
echo "ocamlopt -version"
145+
ocamlopt -version
146+
echo "looking for x86_64-w64-mingw32-as"
147+
find ~/.esy -name "x86_64-w64-mingw32-as*"
148+
echo "print_int 42;; print_newline();;" >testOcaml.ml
149+
echo "build with esy"
150+
esy b ocamlopt.opt -verbose testOcaml.ml -o testOcaml
151+
./testOcaml
152+
echo "build without esy"
153+
ocamlopt.opt testOcaml.ml -o testOcaml
154+
node scripts/prebuilt.js
155+
displayName: "try node scripts/prebuilt.js"

esy.json

Lines changed: 3 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,7 @@
11
{
22
"name": "bs-platform",
3-
"version": "5.2.0-dev.2",
3+
"version": "6.2.1",
44
"dependencies": {
5-
"ocaml": "4.02.3000+BS"
6-
},
7-
"devDependencies": {
8-
"ocaml": "4.02.3000+BS"
9-
},
10-
"resolutions": {
11-
"ocaml": "bucklescript/ocaml:package.json#698e60f3cd2f442f2013e79860ce2f7b0a9624cb"
12-
},
13-
"scripts": {
14-
"clean": "node ./scripts/ninja.js clean"
15-
},
16-
"esy": {
17-
"buildsInSource": true,
18-
"build": [
19-
["node", "./scripts/install.js"],
20-
["cp", "-r", "-f", "#{self.root / 'bsconfig.json'}", "#{self.install}"],
21-
["cp", "-r", "-f", "#{self.root / 'esy.json'}", "#{self.install}"],
22-
["cp", "-r", "-f", "#{self.root / 'package.json'}", "#{self.install}"],
23-
["cp", "-r", "-f", "#{self.root / 'jscomp'}", "#{self.install}"],
24-
["cp", "-r", "-f", "#{self.root / 'jscomp' / 'bin'}", "#{self.install}"],
25-
["cp", "-r", "-f", "#{self.root / 'lib'}", "#{self.install}"],
26-
["cp", "-r", "-f", "#{self.root / 'scripts'}", "#{self.install}"],
27-
["cp", "-r", "-f", "#{self.root / 'vendor'}", "#{self.install}"]
28-
],
29-
"buildDev": [
30-
["echo", "config"],
31-
["node", "./scripts/ninja.js", "config"],
32-
["echo", "build"],
33-
["node", "./scripts/ninja.js", "build"]
34-
],
35-
"buildEnv": {
36-
"ESY": "true"
37-
},
38-
"exportedEnv": {
39-
"OCAMLLIB": {
40-
"val": "#{self.lib / 'ocaml' }",
41-
"scope": "global"
42-
},
43-
"CAML_LD_LIBRARY_PATH": {
44-
"val": "#{self.lib / 'ocaml' / 'stublibs' : self.lib / 'ocaml' : $CAML_LD_LIBRARY_PATH}",
45-
"scope": "global"
46-
},
47-
"OCAML_TOPLEVEL_PATH": {
48-
"val": "#{self.lib / 'ocaml' }",
49-
"scope": "global"
50-
},
51-
"bs_custom_resolution": {
52-
"val": "true",
53-
"scope": "global"
54-
},
55-
"bs_platform__install": {
56-
"val": "#{self.install}",
57-
"scope": "global"
58-
},
59-
"PATH": {
60-
"val": "#{self.lib : $PATH}",
61-
"scope": "global"
62-
}
63-
}
64-
},
65-
"description": "bucklescript compiler for use in esy, ocaml standard libary by bucklescript and its required runtime support",
66-
"repository": {
67-
"type": "git",
68-
"url": "git+https://github.com/bucklescript/bucklescript.git"
69-
},
70-
"keywords": ["ocaml", "bucklescript", "stdlib", "functional programming"],
71-
"author": {
72-
"name": "Hongbo Zhang"
73-
},
74-
"maintainers": [
75-
{
76-
"name": "hongbo_zhang",
77-
"email": "[email protected]"
78-
}
79-
],
80-
"license": "SEE LICENSE IN LICENSE",
81-
"bugs": {
82-
"url": "https://github.com/bucklescript/bucklescript/issues"
83-
},
84-
"homepage": "https://github.com/bucklescript/bucklescript#readme"
5+
"ocaml": "~4.06.1"
6+
}
857
}

esy.lock/index.json

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
{
2-
"checksum": "a0f4fa67bcb1beac6cda121fffdda6bb",
2+
"checksum": "62680885f80ef361d9673f75df49f278",
33
"root": "bs-platform@link-dev:./esy.json",
44
"node": {
5-
"ocaml@github:bucklescript/ocaml:package.json#698e60f3cd2f442f2013e79860ce2f7b0a9624cb@d41d8cd9": {
6-
"id":
7-
"ocaml@github:bucklescript/ocaml:package.json#698e60f3cd2f442f2013e79860ce2f7b0a9624cb@d41d8cd9",
5+
"[email protected]@d41d8cd9": {
6+
"id": "[email protected]@d41d8cd9",
87
"name": "ocaml",
9-
"version":
10-
"github:bucklescript/ocaml:package.json#698e60f3cd2f442f2013e79860ce2f7b0a9624cb",
8+
"version": "4.6.1000",
119
"source": {
1210
"type": "install",
1311
"source": [
14-
"github:bucklescript/ocaml:package.json#698e60f3cd2f442f2013e79860ce2f7b0a9624cb"
12+
"archive:https://registry.npmjs.org/ocaml/-/ocaml-4.6.1000.tgz#sha1:99525ef559353481396454f9a072dedc96b52f44"
1513
]
1614
},
1715
"overrides": [],
@@ -24,12 +22,8 @@
2422
"version": "link-dev:./esy.json",
2523
"source": { "type": "link-dev", "path": ".", "manifest": "esy.json" },
2624
"overrides": [],
27-
"dependencies": [
28-
"ocaml@github:bucklescript/ocaml:package.json#698e60f3cd2f442f2013e79860ce2f7b0a9624cb@d41d8cd9"
29-
],
30-
"devDependencies": [
31-
"ocaml@github:bucklescript/ocaml:package.json#698e60f3cd2f442f2013e79860ce2f7b0a9624cb@d41d8cd9"
32-
]
25+
"dependencies": [ "[email protected]@d41d8cd9" ],
26+
"devDependencies": []
3327
}
3428
}
3529
}

scripts/ciTest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ if (all){
3939
installGlobal = true
4040
ounitTest = true
4141
mochaTest = true
42-
themeTest = true
43-
bsbTest = true
42+
// themeTest = true
43+
// bsbTest = true
4444
}
4545

4646
var os = require('os')

scripts/prebuilt.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function buildCompiler() {
3434
var prebuilt = "prebuilt.ninja";
3535
var content = require("./ninjaFactory.js").libNinja({
3636
ocamlopt: is_windows
37-
? `ocamlopt.opt.exe`
37+
? `esy b ocamlopt.opt -verbose`
3838
: `../native/${ocamlVersion}/bin/ocamlopt.opt`,
3939
ext: sys_extension,
4040
INCL: ocamlVersion,
@@ -58,10 +58,10 @@ var os = require("os");
5858
function createOCamlTar() {
5959
if (os.platform() === hostPlatform) {
6060
cp.execSync(`git -C ocaml status -uno`, { cwd: root, stdio: [0, 1, 2] });
61-
cp.execSync(
62-
`git -C ocaml archive --format=tar.gz HEAD -o ../vendor/ocaml.tar.gz`,
63-
{ cwd: root, stdio: [0, 1, 2] }
64-
);
61+
// cp.execSync(
62+
// `git -C ocaml archive --format=tar.gz HEAD -o ../vendor/ocaml.tar.gz`,
63+
// { cwd: root, stdio: [0, 1, 2] }
64+
// );
6565
// fs.copyFileSync(
6666
// path.join(root, "ocaml", "VERSION"),
6767
// path.join(root, "OCAML_VERSION")

0 commit comments

Comments
 (0)