[CI] Fix CI caching for Cerberus and Cerberus-CHERI (#864) #1869
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
# Install Cerberus (without Coq or CHERI) and run tests | |
name: Cerberus | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- cheri-tests | |
env: | |
CERBERUS_IMAGE_ID: ghcr.io/rems-project/cerberus/cn:release | |
# cancel in-progress job when a new push is performed | |
concurrency: | |
group: ci-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
matrix: | |
# version: [4.12.0, 4.14.1] | |
version: [4.14.1] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout Cerberus | |
uses: actions/checkout@v4 | |
- name: System dependencies (ubuntu) | |
run: | | |
sudo apt-get install build-essential libgmp-dev z3 opam cmake | |
- name: Restore OPAM cache | |
id: cache-opam-restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/.opam | |
key: ${{ matrix.version }} | |
- name: Setup OPAM | |
if: steps.cache-opam-restore.outputs.cache-hit != 'true' | |
run: | | |
opam init --yes --no-setup --shell=sh --compiler=${{ matrix.version }} | |
opam switch create ${{ matrix.version }} ${{ matrix.version }} | |
eval $(opam env --switch=${{ matrix.version }}) | |
opam repo add --yes --this-switch coq-released https://coq.inria.fr/opam/released | |
- name: Save OPAM cache | |
uses: actions/cache/save@v4 | |
if: steps.cache-opam-restore.outputs.cache-hit != 'true' | |
with: | |
path: ~/.opam | |
key: ${{ matrix.version }} | |
- name: Install Cerberus | |
run: | | |
opam switch ${{ matrix.version }} | |
eval $(opam env --switch=${{ matrix.version }}) | |
opam pin --yes --no-action add cerberus-lib . | |
opam pin --yes --no-action add cerberus . | |
opam install --yes cerberus | |
- name: Run Cerberus CI tests | |
run: | | |
opam switch ${{ matrix.version }} | |
eval $(opam env --switch=${{ matrix.version }}) | |
cd tests; USE_OPAM='' ./run-ci.sh |