Skip to content

Commit

Permalink
Add CI build and test
Browse files Browse the repository at this point in the history
  • Loading branch information
dc-mak committed Nov 1, 2024
1 parent 8ba3b1a commit b97cc0c
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 109 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
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]


runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- name: System dependencies (ubuntu)
run: |
sudo apt-get install opam python3 clang-15 opam libclang-15-dev
- 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 --yes .
- name: Run CI tests
run: |
opam switch ${{ matrix.version }}
eval $(opam env --switch=${{ matrix.version }})
dune runtest && cd cpp && ./test/run_test.py make && ./test/run_test.py for
2 changes: 1 addition & 1 deletion c-tree-carver.opam
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ depends: [
"conf-c++"
"conf-cmake" {dev}
"conf-llvm" {= "12.0.1"}
"conf-python3" {with-test}
"conf-python-3" {with-test}
"fileutils" {>= "0.6.4"}
"shexp" {>= "v0.15.0"}
"ocamlformat" {>= "0.25.1" & dev}
Expand Down
6 changes: 3 additions & 3 deletions conf-libclang-12-dev.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ depends: [
"conf-bash" {build}
]
depexts: [
["libclang-12-dev"] {os-family = "debian"}
["libclang-15-dev"] {os-family = "debian"}
]
extra-files: [[
"configure.sh" "sha512=f7f3bedd554da272d3a14d631481bfed0fecce52054cd35fedf41a4493bcc7973fc28abeb305755fb546927785a6f69d1cf2d15b306da35777b471d2bc770864"
]]
synopsis: "Virtual package relying on libclang-12-dev library"
description: "This package can only install if the libclang-12-dev library is installed on the system."
synopsis: "Virtual package relying on libclang-15-dev library"
description: "This package can only install if the libclang-15-dev library is installed on the system."
flags: conf
6 changes: 3 additions & 3 deletions conf-libclang-12-dev.opam.template
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ depends: [
"conf-bash" {build}
]
depexts: [
["libclang-12-dev"] {os-family = "debian"}
["libclang-15-dev"] {os-family = "debian"}
]
extra-files: [[
"configure.sh" "sha512=f7f3bedd554da272d3a14d631481bfed0fecce52054cd35fedf41a4493bcc7973fc28abeb305755fb546927785a6f69d1cf2d15b306da35777b471d2bc770864"
]]
synopsis: "Virtual package relying on libclang-12-dev library"
description: "This package can only install if the libclang-12-dev library is installed on the system."
synopsis: "Virtual package relying on libclang-15-dev library"
description: "This package can only install if the libclang-15-dev library is installed on the system."
flags: conf
8 changes: 4 additions & 4 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
(synopsis "Clang-based tool for tree-carving C source trees")
(description "")
(depends
(ocaml (>= 4.12.0))
(ocaml (>= 4.14.1))
conf-c++
(conf-cmake :dev)
(conf-llvm (= 12.0.1))
(conf-python3 :with-test)
(conf-llvm (= 15.0.7))
(conf-python-3 :with-test)
(fileutils (>= 0.6.4))
(shexp (>= v0.15.0))
(ocamlformat (and (>= 0.25.1) :dev))
Expand All @@ -35,7 +35,7 @@
(topics c clang tool tree-carving)))

(package
(name conf-libclang-12-dev)
(name conf-libclang-15-dev)
(allow_empty))


Expand Down
98 changes: 0 additions & 98 deletions files/configure.sh

This file was deleted.

0 comments on commit b97cc0c

Please sign in to comment.