Skip to content

Commit 1a33f0d

Browse files
committed
CI: Test the compatibility between the development and release versions
At the moment, there is no constraint between the versions of the OCaml/Unikraft packages (aka the ones currently using the version number 1.0.0) and the Unikraft ones (aka the ones currently using the version number 0.18.0). So this adds the possibility to test in CI the compatibility between various versions, in particular between packages released to the opam-repository and packages in development.
1 parent c5c3258 commit 1a33f0d

File tree

1 file changed

+47
-25
lines changed

1 file changed

+47
-25
lines changed

.github/workflows/build.yml

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,68 +16,90 @@ jobs:
1616
test:
1717
name: Run examples on both architectures
1818
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
- ocukver: dev
24+
ukver: dev
25+
- ocukver: 1.0.0
26+
ukver: dev
27+
- ocukver: dev
28+
ukver: 0.18.0
1929
steps:
2030
- name: Checkout code
2131
uses: actions/checkout@v4
2232
- name: Read the version number from gen_opams.ml
23-
run: |
24-
printf 'OCUKVER=%s\n' \
25-
"$(awk '/^let version_ocaml_/ {gsub(/"/,"");print $4;}' gen_opams.ml)" \
26-
>> "$GITHUB_ENV"
27-
printf 'UKVER=%s\n' \
28-
"$(awk '/^let version_unikraft/ {gsub(/"/,"");print $4;}' gen_opams.ml)" \
29-
>> "$GITHUB_ENV"
33+
env:
34+
OCUKVER: ${{ matrix.ocukver }}
35+
UKVER: ${{ matrix.ukver }}
36+
run: |
37+
# OCaml/Unikraft version number
38+
V="$(awk '/^let version_o/ {gsub(/"/,"");print $4;}' gen_opams.ml)"
39+
[[ "$OCUKVER" = dev ]] && OCUKVER="$V"
40+
printf 'OCUKVER=%s\n' "$OCUKVER" >> "$GITHUB_ENV"
41+
# Unikraft version number
42+
U="$(awk '/^let version_u/ {gsub(/"/,"");print $4;}' gen_opams.ml)"
43+
[[ "$UKVER" = dev ]] && UKVER="$U"
44+
printf 'UKVER=%s\n' "$UKVER" >> "$GITHUB_ENV"
45+
# Log
46+
printf 'Dev versions:\n- OCaml/Unikraft: %s\n- Unikraft: %s\n' \
47+
"$V" "$U"
3048
- name: Install OCaml compiler
3149
uses: ocaml/setup-ocaml@v3
3250
with:
3351
ocaml-compiler: 5.3.0
3452
# We need to pin our packages with their real version numbers, to
3553
# satisfy the dependency bounds of the other packages
3654
opam-pin: false
37-
- name: Pin packages
55+
- name: Pin Unikraft packages
3856
run: |
3957
opam pin add -yn "https://github.com/mirage/unikraft.git#$UKVER+mirage"
4058
opam pin add -yn "https://github.com/mirage/unikraft-lib-musl.git#$UKVER+mirage"
41-
opam pin add -yn ocaml-unikraft.$OCUKVER .
42-
opam pin add -yn ocaml-unikraft-arm64.$OCUKVER .
4359
opam pin add -yn ocaml-unikraft-backend-firecracker.$UKVER .
4460
opam pin add -yn ocaml-unikraft-backend-firecracker-arm64.$UKVER .
4561
opam pin add -yn ocaml-unikraft-backend-firecracker-x86_64.$UKVER .
4662
opam pin add -yn ocaml-unikraft-backend-qemu.$UKVER .
4763
opam pin add -yn ocaml-unikraft-backend-qemu-arm64.$UKVER .
4864
opam pin add -yn ocaml-unikraft-backend-qemu-x86_64.$UKVER .
49-
opam pin add -yn ocaml-unikraft-default-arm64.$OCUKVER .
50-
opam pin add -yn ocaml-unikraft-default-x86_64.$OCUKVER .
5165
opam pin add -yn ocaml-unikraft-option-debug.$UKVER .
5266
opam pin add -yn ocaml-unikraft-toolchain-arm64.$UKVER .
5367
opam pin add -yn ocaml-unikraft-toolchain-x86_64.$UKVER .
68+
if: ${{ matrix.ukver == 'dev' }}
69+
- name: Pin OCaml/Unikraft packages
70+
run: |
71+
opam pin add -yn ocaml-unikraft.$OCUKVER .
72+
opam pin add -yn ocaml-unikraft-arm64.$OCUKVER .
73+
opam pin add -yn ocaml-unikraft-default-arm64.$OCUKVER .
74+
opam pin add -yn ocaml-unikraft-default-x86_64.$OCUKVER .
5475
opam pin add -yn ocaml-unikraft-x86_64.$OCUKVER .
76+
if: ${{ matrix.ocukver == 'dev' }}
5577
- name: Install extra packages
5678
run: |
5779
sudo apt-get update -y
5880
sudo apt-get install -y qemu-system-x86 qemu-system-arm
5981
opam install dune
6082
- name: Install arch-specific packages
6183
run: |
62-
opam install \
63-
ocaml-unikraft-x86_64 \
64-
ocaml-unikraft-backend-qemu-x86_64 \
65-
ocaml-unikraft-backend-firecracker-x86_64 \
66-
ocaml-unikraft-arm64 \
67-
ocaml-unikraft-backend-qemu-arm64 \
68-
ocaml-unikraft-backend-firecracker-arm64
84+
opam install \
85+
ocaml-unikraft-x86_64.$OCUKVER \
86+
ocaml-unikraft-backend-qemu-x86_64.$UKVER \
87+
ocaml-unikraft-backend-firecracker-x86_64.$UKVER \
88+
ocaml-unikraft-arm64.$OCUKVER \
89+
ocaml-unikraft-backend-qemu-arm64.$UKVER \
90+
ocaml-unikraft-backend-firecracker-arm64.$UKVER
6991
- name: Show configuration
7092
run: |
7193
opam exec -- ocamlc -config
7294
opam config list
7395
opam list
7496
- name: Install default packages
7597
run: |
76-
opam install \
77-
ocaml-unikraft \
78-
ocaml-unikraft-default-arm64 \
79-
ocaml-unikraft-backend-qemu \
80-
ocaml-unikraft-backend-firecracker
98+
opam install \
99+
ocaml-unikraft.$OCUKVER \
100+
ocaml-unikraft-default-arm64.$OCUKVER \
101+
ocaml-unikraft-backend-qemu.$UKVER \
102+
ocaml-unikraft-backend-firecracker.$UKVER
81103
- name: Show toolchain configuration
82104
run: |
83105
opam exec -- ocamlfind -toolchain unikraft ocamlc -config
@@ -89,7 +111,7 @@ jobs:
89111
opam exec -- dune runtest
90112
- name: Install the other default packages
91113
run: |
92-
opam install ocaml-unikraft-default-x86_64
114+
opam install ocaml-unikraft-default-x86_64.$OCUKVER
93115
- name: Show configuration
94116
run: |
95117
opam exec -- ocamlfind -toolchain unikraft ocamlc -config

0 commit comments

Comments
 (0)