Skip to content

Build and test

Build and test #1875

Workflow file for this run

name: Build and test
on:
push:
pull_request:
schedule:
# run daily, for initializing the cache if not generated yet.
- cron: '41 3 * * *'
jobs:
build:
name: Build and test
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
ocaml-version: ["4.14.1"]
experimental: [false]
# include:
# - ocaml-version: "5.2.0"
# experimental: true
continue-on-error: ${{ matrix.experimental }}
env:
OCAML_VERSION: ${{ matrix.ocaml-version }}
steps:
- name: Update apt cache
run: sudo apt-get update
shell: bash
- name: Checkout
uses: actions/checkout@v3
- name: Free space
run: sudo rm -rf /usr/local/lib/android
- name: Retrieve date for cache key
id: cache-key
run: echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
shell: bash
- name: Restore opam cache
id: opam-cache
uses: actions/cache@v3
with:
path: "~/.opam"
# invalidate cache daily, gets built daily using a scheduled job
key: ${{ steps.cache-key.outputs.date }}-${{ matrix.ocaml-version }}
- name: Use ocaml
uses: avsm/setup-ocaml@v1
with:
ocaml-version: ${{ matrix.ocaml-version }}
opam-repository: "."
- name: Upgrade existing packages
run: |
opam update
opam depext -vv -y xs-toolstack
opam upgrade
- name: Check whether there are packages with more than a version
run: tools/no-duplicates-check.bash
- name: Check whether there are unused packages
run: tools/find-unused-packages.sh
- name: Check whether there are unlicensed packages
run: tools/license-check.sh
- name: Build xs-toolstack, test its dependencies
run: |
OPAMERRLOGLEN=10000 opam list -s --required-by xs-toolstack | xargs opam install -t
- name: Uninstall unversioned packages
# This should purge them from the cache, unversioned package have
# 'master' as its version
run: opam list | awk -F " " '$2 == "master" { print $1 }' | xargs opam uninstall
- name: Install developer tools
run: opam install upstream-extra-dummy