Skip to content

CI

CI #84

Workflow file for this run

name: CI
# Controls when the action will run.
on:
# Run the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Run at 05:37 UTC every Thursday to keep the cache from being evicted.
schedule:
- cron: 37 5 * * THU
# Run when activated manually from the Actions tab
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
coq-version: [ latest ]
ocaml-version: [ default ]
name: Build Schools on Linux (Coq ${{ matrix.coq-version }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout UniMath.
uses: actions/checkout@v4
with:
repository: UniMath/UniMath
clean: false
path: .
- name: Checkout Schools.
uses: actions/checkout@v4
with:
path: Schools
# The path variable here matches the DUNE_CACHE_ROOT variable in the "Build Schools" step
- name: Load cache
uses: actions/cache/restore@v4
id: cache
with:
path: dune-cache
key: UniMath-Schools-${{ runner.os }}-coq-${{ matrix.coq-version }}-${{ github.run_id }}-${{ github.run_number }}
restore-keys: |
UniMath-Schools-${{ runner.os }}-coq-${{ matrix.coq-version }}-${{ github.run_id }}
UniMath-Schools-${{ runner.os }}-coq-${{ matrix.coq-version }}-
- name: Build Schools
uses: coq-community/docker-coq-action@v1
with:
coq_version: ${{ matrix.coq-version }}
ocaml_version: ${{ matrix.ocaml-version }}
custom_script: |
startGroup "Workaround permission issue"
sudo chown -R coq:coq .
endGroup
startGroup "Print versions"
opam --version
opam exec -- dune --version
opam exec -- coqc --version
endGroup
startGroup "Build UniMath"
export DUNE_CACHE_ROOT=$(pwd)/dune-cache/
opam exec -- dune build Schools -j 2 --display=short --cache=enabled --error-reporting=twice
endGroup
# In a separate step, to make sure it runs, even if the previous step fails
- name: Revert permissions
if: ${{ always() }}
run: sudo chown -R 1001:116 .
- name: Save cache
uses: actions/cache/save@v4
if: ${{ always() }}
with:
path: dune-cache
key: UniMath-Schools-${{ runner.os }}-coq-${{ matrix.coq-version }}-${{ github.run_id }}-${{ github.run_number }}