Skip to content

Commit 81a3dc6

Browse files
cknittcristianoc
authored andcommittedDec 6, 2022
Build the whole compiler with dune
1 parent 6e345ff commit 81a3dc6

File tree

166 files changed

+982
-688090
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+982
-688090
lines changed
 

‎.gitattributes

-4
This file was deleted.

‎.github/workflows/ci.yml

+40-42
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525

2626
env:
2727
OCAMLRUNPARAM: b
28+
DUNE_PROFILE: release
2829

2930
steps:
3031
- name: "Windows: Set git to use LF"
@@ -45,6 +46,22 @@ jobs:
4546
opam-pin: false
4647
opam-depext: false
4748

49+
- name: "Install OPAM dependencies"
50+
run: opam install . --deps-only
51+
52+
- name: "Build compiler"
53+
run: |
54+
opam exec -- dune build
55+
./scripts/copyExes.js
56+
57+
- name: Use Node.js
58+
uses: actions/setup-node@v3
59+
with:
60+
node-version: 16
61+
62+
- name: Install npm packages
63+
run: npm ci --ignore-scripts
64+
4865
- name: "Check if syntax subfolder has changed"
4966
id: syntax-diff
5067
shell: bash
@@ -55,25 +72,13 @@ jobs:
5572
echo "syntax_status=changed" >> $GITHUB_ENV
5673
fi
5774
58-
- name: "Syntax: install OPAM dependencies"
59-
if: env.syntax_status == 'changed'
60-
run: opam install . --deps-only
61-
working-directory: res_syntax
62-
63-
- name: "Syntax: build CLI"
64-
if: env.syntax_status == 'changed'
65-
run: opam exec -- dune build
66-
working-directory: res_syntax
67-
6875
- name: "Syntax: Run roundtrip tests"
6976
if: ${{ env.syntax_status == 'changed' && runner.os != 'Windows' }}
70-
run: opam exec -- make roundtrip-test
71-
working-directory: res_syntax
77+
run: opam exec -- make test-syntax-roundtrip
7278

7379
- name: "Syntax: Run tests (Windows)"
7480
if: ${{ env.syntax_status == 'changed' && runner.os == 'Windows' }}
75-
run: opam exec -- make test
76-
working-directory: res_syntax
81+
run: opam exec -- make test-syntax
7782

7883
# Required for ninja build
7984
- name: "Windows: Use MSVC"
@@ -85,26 +90,27 @@ jobs:
8590
- name: Build ninja
8691
run: node scripts/buildNinjaBinary.js
8792

88-
- name: Use Node.js
89-
uses: actions/setup-node@v3
90-
with:
91-
node-version: 16
93+
- name: Build runtime/stdlib
94+
if: runner.os != 'Windows'
95+
run: |
96+
opam exec -- dune exec -- node ./scripts/ninja.js config
97+
opam exec -- dune exec -- node ./scripts/ninja.js build
9298
93-
- name: NPM install
94-
run: opam exec -- npm ci
95-
env:
96-
RESCRIPT_FORCE_REBUILD: 1
99+
- name: Check for changes in lib folder
100+
run: git diff --exit-code lib/js lib/es6
97101

98102
- name: Run tests
99103
if: runner.os != 'Windows'
100-
run: opam exec -- node scripts/ciTest.js -all
104+
run: opam exec -- dune exec -- node scripts/ciTest.js -all
101105

102106
- name: Run tests (Windows)
103107
if: runner.os == 'Windows'
104-
run: opam exec -- node scripts/ciTest.js -mocha -theme -format
108+
run: opam exec -- dune exec -- node scripts/ciTest.js -mocha -theme -format
105109

106-
- name: Get artifact info
107-
run: node .github/workflows/get_artifact_info.js
110+
- name: Prepare artifact upload
111+
run: |
112+
./scripts/prebuilt.js
113+
node .github/workflows/get_artifact_info.js
108114
109115
- name: "Upload artifacts: binaries"
110116
uses: actions/upload-artifact@v3
@@ -119,19 +125,14 @@ jobs:
119125
name: lib-ocaml
120126
path: lib/ocaml
121127

122-
# Important: the ninja build must run after the artifact upload because for some reason
123-
# the bsc.exe created by the ninja build does not find the Pervasives module.
124-
# So this is run here just to test the normal dev workflow, too.
125-
- name: ninja config
126-
if: runner.os != 'Windows'
127-
run: opam exec -- node ./scripts/ninja.js config
128-
129-
- name: ninja build
130-
if: runner.os != 'Windows'
131-
run: opam exec -- node ./scripts/ninja.js build
132-
133-
- name: Check for changes in lib folder
134-
run: git diff --exit-code lib/js lib/es6
128+
- name: "Upload artifacts: cmi cache"
129+
if: runner.os == 'Linux'
130+
uses: actions/upload-artifact@v3
131+
with:
132+
name: cmij-cache
133+
path: |
134+
lib/cmi_cache.bin
135+
lib/cmj_cache.bin
135136
136137
package:
137138
needs: build
@@ -157,9 +158,6 @@ jobs:
157158
- name: Move artifacts
158159
run: ./scripts/moveArtifacts.sh
159160

160-
- name: Create ninja.tar.gz
161-
run: git -C ninja archive --format=tar.gz HEAD -o ../vendor/ninja.tar.gz
162-
163161
- name: Check artifact list
164162
run: node ./scripts/makeArtifactList.js -check
165163

0 commit comments

Comments
 (0)