Skip to content

Commit 82bbdc5

Browse files
authored
Build without docker, use GitHub Linux ARM runner (#1069)
1 parent 6604f4b commit 82bbdc5

File tree

1 file changed

+22
-54
lines changed

1 file changed

+22
-54
lines changed

.github/workflows/ci.yml

+22-54
Original file line numberDiff line numberDiff line change
@@ -11,74 +11,40 @@ concurrency:
1111
group: ${{ github.ref }}
1212
cancel-in-progress: true
1313

14-
jobs:
15-
# Build statically linked Linux binaries in an Alpine-based Docker container
16-
# See https://ocamlpro.com/blog/2021_09_02_generating_static_and_portable_executables_with_ocaml
17-
# for more info.
18-
# The container already comes with all required tools pre-installed
19-
# (see https://github.com/rescript-lang/docker-rescript-ci-build/blob/main/Dockerfile).
20-
build-linux:
21-
strategy:
22-
fail-fast: false
23-
matrix:
24-
os: [ubuntu-latest, buildjet-2vcpu-ubuntu-2204-arm]
25-
# syntax explanation:
26-
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-additional-values-into-combinations
27-
include:
28-
- os: ubuntu-latest
29-
artifact-folder: linux
30-
- os: buildjet-2vcpu-ubuntu-2204-arm
31-
artifact-folder: linuxarm64
32-
33-
runs-on: ${{matrix.os}}
34-
35-
steps:
36-
- name: Checkout
37-
uses: actions/checkout@v4
38-
39-
- name: Build
40-
uses: docker://ghcr.io/rescript-lang/rescript-ci-build:alpine-3.20-ocaml-5.2.0-01
41-
with:
42-
args: opam exec -- dune build --profile static
43-
44-
- name: Copy and strip binaries
45-
run: |
46-
cp -f _build/install/default/bin/rescript-editor-analysis rescript-editor-analysis.exe
47-
cp -f _build/install/default/bin/rescript-tools rescript-tools.exe
48-
strip rescript-editor-analysis.exe rescript-tools.exe
49-
50-
# Also avoids artifacts upload permission loss:
51-
# https://github.com/actions/upload-artifact/tree/ee69f02b3dfdecd58bb31b4d133da38ba6fe3700#permission-loss
52-
- name: Compress files
53-
run: |
54-
mkdir ${{matrix.artifact-folder}}
55-
mv rescript-editor-analysis.exe ${{matrix.artifact-folder}}
56-
mv rescript-tools.exe ${{matrix.artifact-folder}}
57-
tar -cvf binary.tar ${{matrix.artifact-folder}}
58-
59-
- name: "Upload artifacts"
60-
uses: actions/upload-artifact@v4
61-
with:
62-
name: ${{matrix.artifact-folder}}
63-
path: binary.tar
64-
14+
jobs:
6515
build:
6616
strategy:
6717
fail-fast: false
6818
matrix:
6919
os: [
7020
macos-13, # x64
7121
macos-14, # ARM
22+
ubuntu-24.04, # x64
23+
ubuntu-24.04-arm, # ARM
7224
windows-latest,
7325
]
7426
# syntax explanation:
7527
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-additional-values-into-combinations
7628
include:
7729
- os: macos-13
30+
ocaml-compiler: 5.2.1
31+
dune-profile: release
7832
artifact-folder: darwin
7933
- os: macos-14
34+
ocaml-compiler: 5.2.1
35+
dune-profile: release
8036
artifact-folder: darwinarm64
37+
- os: ubuntu-24.04
38+
ocaml-compiler: ocaml-variants.5.2.1+options,ocaml-option-static
39+
dune-profile: static
40+
artifact-folder: linux
41+
- os: ubuntu-24.04-arm
42+
ocaml-compiler: ocaml-variants.5.2.1+options,ocaml-option-static
43+
dune-profile: static
44+
artifact-folder: linuxarm64
8145
- os: windows-latest
46+
ocaml-compiler: 5.2.1
47+
dune-profile: release
8248
artifact-folder: win32
8349

8450
runs-on: ${{matrix.os}}
@@ -101,7 +67,7 @@ jobs:
10167
- name: Use OCaml
10268
uses: ocaml/setup-ocaml@v3
10369
with:
104-
ocaml-compiler: 5.2.0
70+
ocaml-compiler: ${{matrix.ocaml-compiler}}
10571
opam-pin: false
10672

10773
- name: Use Node.js
@@ -120,6 +86,9 @@ jobs:
12086
# - run: opam pin add rescript-editor-analysis.dev . --no-action
12187
# - run: opam install . --deps-only --with-doc --with-test
12288

89+
- name: Set dune profile according to platform
90+
run: echo "DUNE_PROFILE=${{ matrix.dune-profile }}" >> $GITHUB_ENV
91+
12392
- name: Build
12493
run: opam exec -- make
12594

@@ -147,8 +116,7 @@ jobs:
147116
package:
148117
needs:
149118
- build
150-
- build-linux
151-
runs-on: ubuntu-latest
119+
runs-on: ubuntu-24.04
152120

153121
steps:
154122
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)