Build and test #576
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test | |
on: | |
push: | |
pull_request: | |
schedule: | |
# run daily, this refreshes the cache | |
- cron: "13 2 * * *" | |
concurrency: # On new push, cancel old workflows from the same PR, branch or tag: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
ocaml-tests: | |
name: Run OCaml tests | |
runs-on: ubuntu-22.04 | |
env: | |
# Ensure you also update test-sdk-builds | |
# when changing this value, to keep builds | |
# consistent | |
XAPI_VERSION: "v0.0.0" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup XenAPI environment | |
uses: ./.github/workflows/setup-xapi-environment | |
with: | |
xapi_version: ${{ env.XAPI_VERSION }} | |
- name: Build | |
run: opam exec -- make | |
- name: Run tests | |
run: opam exec -- make test | |
- name: Check all code | |
run: opam exec -- make check | |
- name: Run stress tests | |
run: opam exec -- make stresstest | |
if: ${{ github.event_name == 'schedule' }} | |
- name: Make install smoketest | |
run: | | |
opam exec -- make install DESTDIR=$(mktemp -d) | |
opam exec -- make install DESTDIR=$(mktemp -d) BUILD_PY2=NO | |
- name: Check disk space | |
run: df -h || true | |
- name: Trim dune cache | |
run: opam exec -- dune cache trim --size=2GiB |