1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
|
name: CI
on: [workflow_dispatch]
env:
OPAMYES: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-15, windows-latest]
ocaml-compiler: [4.14.2, 5.3.0]
setup-version: [v3]
outputs:
total_matrix_jobs: ${{ strategy.job-total || 0 }}
metric: ${{ steps.collect-metrics.outputs.metric }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Start Build Timer
uses: ./.github/actions/ci-utils
with:
command: start-timer
- name: Cache Opam dependencies (Unix)
id: cache-opam-unix
if: runner.os != 'Windows'
uses: actions/cache@v4
with:
path: ~/.opam
key: unix-${{ matrix.ocaml-compiler }}-with-test-${{ matrix.setup-version }}-${{ hashFiles('*.opam') }}-cache
restore-keys: unix-${{ matrix.ocaml-compiler }}-with-test-${{ matrix.setup-version }}
- name: Cache Opam dependencies (Windows)
id: cache-opam-windows
if: runner.os == 'Windows'
uses: actions/cache@v4
with:
path: D:\.opam
key: windows-${{ matrix.ocaml-compiler }}-with-test-${{ matrix.setup-version }}-${{ hashFiles('*.opam') }}-cache
restore-keys: windows-${{ matrix.ocaml-compiler }}-with-test-${{ matrix.setup-version }}
- name: Setup Ocaml with v3
if: matrix.setup-version == 'v3'
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
- name: Show what is cached
run: |
opam switch
opam list
opam pin list
- name: install Perl deps
if: runner.os == 'Windows'
run: |
set -x
cpan -j tools/Config.pm -T -f -i String::ShellQuote || true
cpan -j tools/Config.pm -T -f -i IPC::System::Simple || true
cpan -J
perl -MString::Shellquote -e 'print "String::ShellQuote installed\n"'
perl -MIPC::System::Simple -e 'print "IPC::System::Simple installed\n"'
shell: bash
- name: Pin some dependencies
if: matrix.setup-version == 'v3'
run: |
opam pin add --no-action ocamlfind https://github.com/chetmurthy/ocamlfind.git
opam pin add --no-action not-ocamlfind https://github.com/chetmurthy/not-ocamlfind.git
opam pin add --no-action camlp5-buildscripts https://github.com/camlp5/camlp5-buildscripts.git
- name: Install Camlp5 dependencies
run: |
opam install --deps-only --with-test .
- name: Configure Camlp5
run: |
opam exec -- bash ./configure
shell: bash
- name: build Camlp5
run: |
opam exec -- make all world.opt
shell: bash
- name: List all installed packages
run: |
opam list
shell: bash
- name: test Camlp5
run: |
opam exec -- make -C testsuite clean
opam exec -- make -C testsuite -k all-tests
shell: bash
- name: Do it with opam
run: opam install -t .
- name: Collect Build Metrics
id: collect-metrics
uses: ./.github/actions/ci-utils
with:
command: collect-metrics
os: ${{ matrix.os }}
ocaml-version: ${{ matrix.ocaml-compiler }}
cache-hit: ${{ runner.os != 'Windows' && steps.cache-opam-unix.outputs.cache-hit || steps.cache-opam-windows.outputs.cache-hit }}
build-results:
needs: [build]
runs-on: ubuntu-latest
if: always()
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Generate Build Summary
uses: ./.github/actions/ci-utils
with:
command: generate-summary
total-builds: ${{ needs.build.outputs.total_matrix_jobs }}
|