···11*.ml linguist-language=OCaml
22+33+# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding?view=powershell-7.1
44+*.ps1 text working-tree-encoding=UTF-16 eol=crlf
55+*.psm1 text working-tree-encoding=UTF-16 eol=crlf
66+# Other file types that must be CRLF
77+*.sln text eol=crlf
+102
.github/workflows/dkml.yml
···11+##########################################################################
22+# File: dktool/cmake/scripts/dkml/workflow/compilers-github-workflows-dkml.in.yml#
33+# #
44+# Copyright 2022 Diskuv, Inc. #
55+# #
66+# Licensed under the Apache License, Version 2.0 (the "License"); #
77+# you may not use this file except in compliance with the License. #
88+# You may obtain a copy of the License at #
99+# #
1010+# http://www.apache.org/licenses/LICENSE-2.0 #
1111+# #
1212+# Unless required by applicable law or agreed to in writing, software #
1313+# distributed under the License is distributed on an "AS IS" BASIS, #
1414+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or #
1515+# implied. See the License for the specific language governing #
1616+# permissions and limitations under the License. #
1717+# #
1818+##########################################################################
1919+2020+# Updating
2121+# --------
2222+#
2323+# 1. Delete this file.
2424+# 2. Run dk with your original arguments:
2525+# ./dk dkml.workflow.compilers CI GitHub Desktop OS Windows
2626+# or get help to come up with new arguments:
2727+# ./dk dkml.workflow.compilers HELP
2828+2929+name: Build with DkML compiler
3030+3131+on:
3232+ # trigger on any push
3333+ push:
3434+ # ... or trigger manually from GitHub web interface
3535+ workflow_dispatch:
3636+3737+jobs:
3838+ build:
3939+ strategy:
4040+ matrix:
4141+ include: #
4242+ - gh_os: windows-2019
4343+ abi_pattern: win32-windows_x86
4444+ dkml_host_abi: windows_x86
4545+ - gh_os: windows-2019
4646+ abi_pattern: win32-windows_x86_64
4747+ dkml_host_abi: windows_x86_64
4848+4949+ runs-on: ${{ matrix.gh_os }}
5050+ name: build / ${{ matrix.abi_pattern }}
5151+5252+ steps:
5353+ - name: Checkout code
5454+ uses: actions/checkout@v3
5555+5656+ - name: Cache DkML compilers code
5757+ uses: actions/cache@v3
5858+ id: cache-dkml-compilers
5959+ with:
6060+ path: .ci/dkml-compilers
6161+ key: ${{ runner.os }}
6262+6363+ - name: Checkout DkML compilers code
6464+ if: steps.cache-dkml-compilers.outputs.cache-hit != 'true'
6565+ # For help: ./dk dkml.workflow.compilers HELP
6666+ run: ./dk dkml.workflow.compilers CI GitHub
6767+6868+ # The .ci/dkml-compilers "pre" actions will create the environment variables:
6969+ # opam_root, exe_ext, dkml_host_abi, abi_pattern (and many more)
7070+ #
7171+ - name: Setup DkML compilers on a Windows host
7272+ if: startsWith(matrix.dkml_host_abi, 'windows_')
7373+ uses: ./.ci/dkml-compilers/gh-windows/pre
7474+ with:
7575+ DKML_COMPILER: ${{ env.DKML_COMPILER }}
7676+ CACHE_PREFIX: ${{ env.CACHE_PREFIX }}
7777+7878+ # This section is for your own build logic which you should place in
7979+ # ci/build-test.sh or a similar file
8080+8181+ - name: Build and test on Windows host
8282+ if: startsWith(matrix.dkml_host_abi, 'windows_')
8383+ shell: msys2 {0}
8484+ run: ci/build-test.sh
8585+8686+ - name: Build and test on non-Windows host
8787+ if: "!startsWith(matrix.dkml_host_abi, 'windows_')"
8888+ run: ci/build-test.sh
8989+9090+ # The .ci/dkml-compilers "post" actions will finalize caching, etc.
9191+9292+ - name: Teardown DkML compilers on a Windows host
9393+ if: startsWith(matrix.dkml_host_abi, 'windows_')
9494+ uses: ./.ci/dkml-compilers/gh-windows/post
9595+9696+ - name: Teardown DkML compilers on a Darwin host
9797+ if: startsWith(matrix.dkml_host_abi, 'darwin_')
9898+ uses: ./.ci/dkml-compilers/gh-darwin/post
9999+100100+ - name: Teardown DkML compilers on a Linux host
101101+ if: startsWith(matrix.dkml_host_abi, 'linux_')
102102+ uses: ./.ci/dkml-compilers/gh-linux/post
+10
.gitignore
···1515mirage/.mirage.config
1616_opam
1717*.install
1818+1919+# CI using dkml-workflows' DkML compilers.
2020+# DkML compilers populate the .opam folder.
2121+/.opam/
2222+# GitHub, unlike GitLab, does not need its CI files to exist
2323+# before referencing them. That means the GitHub scripts do not need
2424+# to be checked in.
2525+/.ci/dkml-compilers/gh-*
2626+# Desktop testing on Windows uses MSYS2.
2727+/msys64/
+84
ci/build-test.sh
···11+#!/bin/sh
22+##########################################################################
33+# File: dktool/cmake/scripts/dkml/workflow/compilers-build-test.in.sh #
44+# #
55+# Copyright 2022 Diskuv, Inc. #
66+# #
77+# Licensed under the Apache License, Version 2.0 (the "License"); #
88+# you may not use this file except in compliance with the License. #
99+# You may obtain a copy of the License at #
1010+# #
1111+# http://www.apache.org/licenses/LICENSE-2.0 #
1212+# #
1313+# Unless required by applicable law or agreed to in writing, software #
1414+# distributed under the License is distributed on an "AS IS" BASIS, #
1515+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or #
1616+# implied. See the License for the specific language governing #
1717+# permissions and limitations under the License. #
1818+# #
1919+##########################################################################
2020+2121+# Updating
2222+# --------
2323+#
2424+# 1. Delete this file.
2525+# 2. Run dk with your original arguments:
2626+# ./dk dkml.workflow.compilers CI GitHub Desktop OS Windows
2727+# or get help to come up with new arguments:
2828+# ./dk dkml.workflow.compilers HELP
2929+3030+set -euf
3131+3232+# Set project directory
3333+if [ -n "${CI_PROJECT_DIR:-}" ]; then
3434+ PROJECT_DIR="$CI_PROJECT_DIR"
3535+elif [ -n "${PC_PROJECT_DIR:-}" ]; then
3636+ PROJECT_DIR="$PC_PROJECT_DIR"
3737+elif [ -n "${GITHUB_WORKSPACE:-}" ]; then
3838+ PROJECT_DIR="$GITHUB_WORKSPACE"
3939+else
4040+ PROJECT_DIR="$PWD"
4141+fi
4242+if [ -x /usr/bin/cygpath ]; then
4343+ PROJECT_DIR=$(/usr/bin/cygpath -au "$PROJECT_DIR")
4444+fi
4545+4646+# shellcheck disable=SC2154
4747+echo "
4848+=============
4949+build-test.sh
5050+=============
5151+.
5252+---------
5353+Arguments
5454+---------
5555+$*
5656+.
5757+------
5858+Matrix
5959+------
6060+dkml_host_abi=$dkml_host_abi
6161+abi_pattern=$abi_pattern
6262+opam_root=$opam_root
6363+exe_ext=${exe_ext:-}
6464+.
6565+"
6666+6767+# PATH. Add opamrun
6868+export PATH="$PROJECT_DIR/.ci/sd4/opamrun:$PATH"
6969+7070+# Initial Diagnostics (optional but useful)
7171+opamrun switch
7272+opamrun list
7373+opamrun var
7474+opamrun config report
7575+opamrun option
7676+opamrun exec -- ocamlc -config
7777+7878+# Update
7979+opamrun update
8080+8181+# Make your own build logic!
8282+opamrun install --yes --deps-only -t mirage-crypto mirage-crypto-rng mirage-crypto-rng-lwt mirage-crypto-rng-mirage mirage-crypto-pk mirage-crypto-ec
8383+opamrun exec -- dune build -p mirage-crypto,mirage-crypto-rng,mirage-crypto-rng-lwt,mirage-crypto-rng-mirage,mirage-crypto-pk,mirage-crypto-ec
8484+opamrun exec -- dune runtest -p mirage-crypto,mirage-crypto-rng,mirage-crypto-rng-lwt,mirage-crypto-rng-mirage,mirage-crypto-pk,mirage-crypto-ec