Skip to content

Commit 800b629

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 1321024 commit 800b629

File tree

1 file changed

+46
-25
lines changed

1 file changed

+46
-25
lines changed

.github/workflows/build.yml

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,68 +16,89 @@ jobs:
1616
test:
1717
name: Run examples on both architectures
1818
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
include:
22+
- ocukver: dev
23+
ukver: dev
24+
- ocukver: 1.0.0
25+
ukver: dev
26+
- ocukver: dev
27+
ukver: 0.18.0
1928
steps:
2029
- name: Checkout code
2130
uses: actions/checkout@v4
2231
- 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"
32+
env:
33+
OCUKVER: ${{ matrix.ocukver }}
34+
UKVER: ${{ matrix.ukver }}
35+
run: |
36+
# OCaml/Unikraft version number
37+
V="$(awk '/^let version_o/ {gsub(/"/,"");print $4;}' gen_opams.ml)"
38+
[[ "$OCUKVER" = dev ]] && OCUKVER="$V"
39+
printf 'OCUKVER=%s\n' "$OCUKVER" >> "$GITHUB_ENV"
40+
# Unikraft version number
41+
U="$(awk '/^let version_u/ {gsub(/"/,"");print $4;}' gen_opams.ml)"
42+
[[ "$UKVER" = dev ]] && UKVER="$U"
43+
printf 'UKVER=%s\n' "$UKVER" >> "$GITHUB_ENV"
44+
# Log
45+
printf 'Dev versions:\n- OCaml/Unikraft: %s\n- Unikraft: %s\n' \
46+
"$V" "$U"
3047
- name: Install OCaml compiler
3148
uses: ocaml/setup-ocaml@v3
3249
with:
3350
ocaml-compiler: 5.3.0
3451
# We need to pin our packages with their real version numbers, to
3552
# satisfy the dependency bounds of the other packages
3653
opam-pin: false
37-
- name: Pin packages
54+
- name: Pin Unikraft packages
3855
run: |
3956
opam pin add -yn "https://github.com/mirage/unikraft.git#$UKVER+mirage"
4057
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 .
4358
opam pin add -yn ocaml-unikraft-backend-firecracker.$UKVER .
4459
opam pin add -yn ocaml-unikraft-backend-firecracker-arm64.$UKVER .
4560
opam pin add -yn ocaml-unikraft-backend-firecracker-x86_64.$UKVER .
4661
opam pin add -yn ocaml-unikraft-backend-qemu.$UKVER .
4762
opam pin add -yn ocaml-unikraft-backend-qemu-arm64.$UKVER .
4863
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 .
5164
opam pin add -yn ocaml-unikraft-option-debug.$UKVER .
5265
opam pin add -yn ocaml-unikraft-toolchain-arm64.$UKVER .
5366
opam pin add -yn ocaml-unikraft-toolchain-x86_64.$UKVER .
67+
if: ${{ matrix.ukver == 'dev' }}
68+
- name: Pin OCaml/Unikraft packages
69+
run: |
70+
opam pin add -yn ocaml-unikraft.$OCUKVER .
71+
opam pin add -yn ocaml-unikraft-arm64.$OCUKVER .
72+
opam pin add -yn ocaml-unikraft-default-arm64.$OCUKVER .
73+
opam pin add -yn ocaml-unikraft-default-x86_64.$OCUKVER .
5474
opam pin add -yn ocaml-unikraft-x86_64.$OCUKVER .
75+
if: ${{ matrix.ocukver == 'dev' }}
5576
- name: Install extra packages
5677
run: |
5778
sudo apt-get update -y
5879
sudo apt-get install -y qemu-system-x86 qemu-system-arm
5980
opam install dune
6081
- name: Install arch-specific packages
6182
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
83+
opam install \
84+
ocaml-unikraft-x86_64.$OCUKVER \
85+
ocaml-unikraft-backend-qemu-x86_64.$UKVER \
86+
ocaml-unikraft-backend-firecracker-x86_64.$UKVER \
87+
ocaml-unikraft-arm64.$OCUKVER \
88+
ocaml-unikraft-backend-qemu-arm64.$UKVER \
89+
ocaml-unikraft-backend-firecracker-arm64.$UKVER
6990
- name: Show configuration
7091
run: |
7192
opam exec -- ocamlc -config
7293
opam config list
7394
opam list
7495
- name: Install default packages
7596
run: |
76-
opam install \
77-
ocaml-unikraft \
78-
ocaml-unikraft-default-arm64 \
79-
ocaml-unikraft-backend-qemu \
80-
ocaml-unikraft-backend-firecracker
97+
opam install \
98+
ocaml-unikraft.$OCUKVER \
99+
ocaml-unikraft-default-arm64.$OCUKVER \
100+
ocaml-unikraft-backend-qemu.$UKVER \
101+
ocaml-unikraft-backend-firecracker.$UKVER
81102
- name: Show toolchain configuration
82103
run: |
83104
opam exec -- ocamlfind -toolchain unikraft ocamlc -config
@@ -89,7 +110,7 @@ jobs:
89110
opam exec -- dune runtest
90111
- name: Install the other default packages
91112
run: |
92-
opam install ocaml-unikraft-default-x86_64
113+
opam install ocaml-unikraft-default-x86_64.$OCUKVER
93114
- name: Show configuration
94115
run: |
95116
opam exec -- ocamlfind -toolchain unikraft ocamlc -config

0 commit comments

Comments
 (0)