Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
622df60
chore: migrate to using dune package management
sabine May 26, 2025
b0fcca7
make Dockerfile use Dune Developer Preview to build
sabine May 28, 2025
de77a3d
update Makefile to use Dune Developer Preview
sabine May 28, 2025
3544e64
remove .opam files
sabine May 28, 2025
c261526
update HACKING.md for dune pkg, CONTRIBUTING.md doesn't need updating
sabine Jun 6, 2025
620267a
attempt to make Playground build with Dune Developer Preview (fails)
sabine May 28, 2025
017f2a5
Build playground with dune pkg
Sudha247 Jun 11, 2025
59dd5ef
update CI to use Dune Developer Preview
sabine Jun 16, 2025
e5af6bd
update scraper workflow to use dev preview
sabine Jun 16, 2025
6e622e2
copy playground cmi files
sabine Jun 16, 2025
f1e40ec
update playground gitignore
sabine Jun 17, 2025
95bfd9c
remove opam.locked file
sabine Jun 17, 2025
22a546a
rely on dune.lock
sabine Jun 17, 2025
12ed046
remove obsolete config
sabine Jun 17, 2025
5d6f6ca
build scraper in makefile
sabine Jun 17, 2025
a247128
rely on dune.lock
sabine Jun 17, 2025
3a1d3e6
Pin dune pkg to a specific version in the Dockerfile
Sudha247 Jul 17, 2025
343d032
update Dockerfile and HACKING.md
Sudha247 Jul 18, 2025
dffbaa2
revert accidental playground changes
sabine Jul 23, 2025
b0b8c50
Update to use Dune binary
Sudha247 Aug 1, 2025
fd507da
Address review comments
Sudha247 Aug 1, 2025
3a0eef0
add ocamlformat as a test dependency
Sudha247 Aug 1, 2025
2501b76
remove river pin
sabine Aug 19, 2025
b693e90
reduce changes to playground dune-project
sabine Aug 19, 2025
44dd273
update README.md and HACKING.md
sabine Aug 28, 2025
7b17c83
update workflows to use Dune 3.19.1 binary
sabine Aug 28, 2025
e826207
add a workflow to build every day using Dune Developer Preview
sabine Aug 28, 2025
b0bbc9a
remove unnecessary compiler version parameter from workflows
sabine Aug 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
!tool/
!dune
!dune-project
!ocamlorg.opam
!dune-workspace
!tailwind.config.js
!init-cache
!.git
41 changes: 41 additions & 0 deletions .github/workflows/build_with_dev_preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build OCaml.org Using Dune Developer Preview

on:
workflow_dispatch:
schedule:
# Run every day
- cron: 36 5 * * *

jobs:
build:
name: Build OCaml.org Using Dune Developer Preview

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest

steps:
- name: Install system dependencies (Linux)
run: sudo apt update && sudo apt-get install libev-dev libonig-dev libcurl4-openssl-dev
if: runner.os == 'Linux'

- name: Install system dependencies (macOS)
run: brew update && brew reinstall libev openssl@3 # Openssl is a workaround for https://github.com/ocaml/opam-repository/issues/19676
if: runner.os == 'macOS'

- name: Setup Dune Developer Preview
uses: ocaml-dune/setup-dune@v0

- name: Checkout Repo
uses: actions/checkout@v5

- name: Build project
run: make

- name: Run tests
run: make test
24 changes: 6 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,8 @@ jobs:
os:
- macos-latest
- ubuntu-latest
ocaml-compiler:
- "5.2.0"

steps:
- name: Checkout Repo
uses: actions/checkout@v5

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: ${{ matrix.os != 'macos-latest' }}
opam-repositories: |
pin: git+https://github.com/ocaml/opam-repository#584630e7a7e27e3cf56158696a3fe94623a0cf4f
opam-disable-sandboxing: true

- name: Install system dependencies (Linux)
run: sudo apt update && sudo apt-get install libev-dev libonig-dev libcurl4-openssl-dev
if: runner.os == 'Linux'
Expand All @@ -46,11 +32,13 @@ jobs:
run: brew update && brew reinstall libev openssl@3 # Openssl is a workaround for https://github.com/ocaml/opam-repository/issues/19676
if: runner.os == 'macOS'

- name: Install opam dependencies
run: opam install --deps-only --with-test .
- name: Setup Dune
uses: ocaml-dune/setup-dune@v0
with:
version: 3.19.1

- name: Install ocamlformat
run: opam install ocamlformat.0.26.2
- name: Checkout Repo
uses: actions/checkout@v5

- name: Build project
run: make
Expand Down
32 changes: 10 additions & 22 deletions .github/workflows/debug-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,8 @@ jobs:
os:
- macos-latest
- ubuntu-latest
ocaml-compiler:
- "5.2.0"

steps:
- name: Checkout Repo
uses: actions/checkout@v5

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: ${{ matrix.os != 'macos-latest' }}
opam-repositories: |
pin: git+https://github.com/ocaml/opam-repository#584630e7a7e27e3cf56158696a3fe94623a0cf4f
opam-disable-sandboxing: true

- name: Install system dependencies (Linux)
run: sudo apt update && sudo apt-get install libev-dev libonig-dev libcurl4-openssl-dev
if: runner.os == 'Linux'
Expand All @@ -39,18 +25,20 @@ jobs:
run: brew update && brew reinstall libev openssl@3 # Openssl is a workaround for https://github.com/ocaml/opam-repository/issues/19676
if: runner.os == 'macOS'

- name: Install opam dependencies
run: opam install --deps-only --with-test .
- name: Setup Dune
uses: ocaml-dune/setup-dune@v0
with:
version: 3.19.1

- name: Install ocamlformat
run: opam install ocamlformat.0.26.2
- name: Checkout Repo
uses: actions/checkout@v5

- name: Build project
run: opam exec -- dune build @install
run: make

- name: Run tests
run: opam exec -- dune test
run: make test

- name: Format code
run: opam exec -- dune build --auto-promote @fmt
if: runner.os == 'Linux'
run: make fmt
if: runner.os == 'Linux'
3 changes: 3 additions & 0 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v5
with:
fetch-depth: 0

- uses: tj-actions/changed-files@v46
id: changed-files
with:
Expand All @@ -17,6 +19,7 @@ jobs:
!data/planet/**/*.md
!data/changelog/**/*.md
separator: ","

- uses: DavidAnson/markdownlint-cli2-action@v20
if: steps.changed-files.outputs.any_changed == 'true'
with:
Expand Down
23 changes: 5 additions & 18 deletions .github/workflows/scrape.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,18 @@ jobs:
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- "5.2.0"

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
- name: Setup Dune
uses: ocaml-dune/setup-dune@v0
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: ${{ matrix.os != 'macos-latest' }}
opam-repositories: |
pin: git+https://github.com/ocaml/opam-repository#584630e7a7e27e3cf56158696a3fe94623a0cf4f
opam-disable-sandboxing: true
version: 3.19.1

- name: Install system dependencies
run: sudo apt update && sudo apt-get install libev-dev libonig-dev libcurl4-openssl-dev

- name: Install opam dependencies
run: opam install --deps-only --with-test .

- name: Build scraper
run: |
opam exec -- dune build tool/ood-gen/bin/scrape.exe
- name: Checkout code
uses: actions/checkout@v5

- name: Run scrapers
run: |
Expand Down
25 changes: 6 additions & 19 deletions .github/workflows/scrape_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,20 @@ jobs:
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- "5.2.0"

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
- name: Setup Dune
uses: ocaml-dune/setup-dune@v0
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: ${{ matrix.os != 'macos-latest' }}
opam-repositories: |
pin: git+https://github.com/ocaml/opam-repository#584630e7a7e27e3cf56158696a3fe94623a0cf4f
opam-disable-sandboxing: true
version: 3.19.1

- name: Install system dependencies
run: sudo apt update && sudo apt-get install libev-dev libonig-dev libcurl4-openssl-dev

- name: Install opam dependencies
run: opam install --deps-only --with-test .

- name: Build scraper
run: |
opam exec -- dune build tool/ood-gen/bin/scrape.exe
- name: Checkout code
uses: actions/checkout@v5

- name: Run scrapers
- name: Run scraper
run: |
make scrape_changelog

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Dune artifacts
_build/
dune.lock
dev-tools.locks

# Local OPAM switch
_opam/
Expand Down
36 changes: 16 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM ocaml/opam:alpine-3.21-ocaml-5.2 AS build
FROM alpine:3.21 AS build

# Install system dependencies
RUN sudo apk -U upgrade --no-cache && sudo apk add --no-cache \
RUN apk -U upgrade --no-cache && apk add --no-cache \
# to download and install Dune Developer Preview with alpine:3.21
build-base patch tar ca-certificates git \
libx11-dev coreutils xz curl bash \
autoconf \
curl-dev \
gmp-dev \
Expand All @@ -10,25 +13,18 @@ RUN sudo apk -U upgrade --no-cache && sudo apk add --no-cache \
oniguruma-dev \
openssl-dev

# Use Opam 2.2 and enable the backup mirror if primary sources of packages are unavailable
RUN sudo mv /usr/bin/opam-2.2 /usr/bin/opam && opam update
RUN opam option --global 'archive-mirrors+="https://opam.ocaml.org/cache"'

# Branch freeze was opam-repo HEAD at the time of commit
RUN cd ~/opam-repository && git reset --hard 584630e7a7e27e3cf56158696a3fe94623a0cf4f && opam update

WORKDIR /home/opam

# Install opam dependencies
COPY --chown=opam ocamlorg.opam .
RUN opam install . --deps-only
RUN curl -sSL https://github.com/ocaml-dune/dune-bin-install/releases/download/v1/install.sh | sh -s 3.19.1 --install-root /usr --no-update-shell-config
RUN dune --version

# Build project
COPY --chown=opam . .
RUN opam exec -- dune build @install --profile=release
WORKDIR "/root/ocaml.org"
COPY --chown=root . .
RUN ls

RUN dune pkg lock
RUN dune build @install --profile=release

# Launch project in order to generate the package state cache
RUN cd ~/opam-repository && git checkout master && git pull origin master && opam update
ENV OCAMLORG_PKG_STATE_PATH=package.state \
OCAMLORG_REPO_PATH=opam-repository
RUN touch package.state && ./init-cache package.state
Expand All @@ -40,9 +36,9 @@ RUN apk -U upgrade --no-cache && apk add --no-cache \
gmp \
libev

COPY --from=build /home/opam/package.state /var/package.state
COPY --from=build /home/opam/opam-repository /var/opam-repository
COPY --from=build /home/opam/_build/default/src/ocamlorg_web/bin/main.exe /bin/server
COPY --from=build "/root/ocaml.org/package.state" /var/package.state
COPY --from=build "/root/ocaml.org/opam-repository" /var/opam-repository
COPY --from=build "/root/ocaml.org/_build/default/src/ocamlorg_web/bin/main.exe" /bin/server

COPY playground/asset playground/asset

Expand Down
Loading
Loading