forked from logicmachine/cpp-simplifier
-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (54 loc) · 1.88 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: CI
on:
pull_request:
push:
branches:
- main
- cheri-tests
# 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.14.1, 5.2.0]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
# clang-15 is for ClangConfig.cmake
# libclang-14-dev and libclang-cpp14-dev are for the (silly) opam conf-libclang.15 package
# more details: https://github.com/ocaml/opam-repository/issues/26827
# llvm-15-dev is for LLVMConfig.cmake
- name: System dependencies (ubuntu)
run: |
sudo apt-get install clang-15 cmake libclang-14-dev libclang-15-dev libclang-cpp14-dev llvm-15-dev opam python3
- name: Restore cached opam
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 install --with-test --deps-only --yes .
- name: Save cached opam
if: steps.cache-opam-restore.outputs.cache-hit != 'true'
id: cache-opam-save
uses: actions/cache/save@v4
with:
path: ~/.opam
key: ${{ steps.cache-opam-restore.outputs.cache-primary-key }}
- name: Install c-tree-carver
run: |
opam switch ${{ matrix.version }}
eval $(opam env --switch=${{ matrix.version }})
opam install --with-test --yes .
- name: Run CI tests
run: |
opam switch ${{ matrix.version }}
eval $(opam env --switch=${{ matrix.version }})
dune runtest && cd cpp && python3 ./test/run_test.py make && python3 ./test/run_test.py for --carver clang-tree-carve.exe