Skip to content

Commit fbcc05b

Browse files
committed
Add a Dockerfile github action.
This adds a github action that builds CBMC in a Docker container, and then exercises a small suite of smoke tests on it to make sure that the image is sound.
1 parent 37a6c9f commit fbcc05b

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

.github/workflows/pull-request-checks.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,3 +349,24 @@ jobs:
349349
- uses: actions/checkout@v2
350350
- name: Check for unused irep ids
351351
run: ./scripts/string_table_check.sh
352+
353+
check-docker-image:
354+
runs-on: ubuntu-20.04
355+
steps:
356+
- uses: actions/checkout@v2
357+
with:
358+
submodules: recursive
359+
- name: Download test dependencies
360+
run: sudo apt install openjdk-11-jdk-headless
361+
- name: Build docker image
362+
run: docker build -t cbmc .
363+
- name: Smoke test goto-cc
364+
run: docker run -v ${PWD}/.github/workflows/smoke_test_assets:/mnt/smoke -t cbmc goto-cc -o /mnt/smoke/test.goto /mnt/smoke/test.c
365+
- name: Smoke test cbmc
366+
run: docker run -v ${PWD}/.github/workflows/smoke_test_assets:/mnt/smoke -t cbmc cbmc /mnt/smoke/test.goto
367+
- name: Smoke test jbmc
368+
run: |
369+
javac .github/workflows/smoke_test_assets/Test.java
370+
docker run -v ${PWD}/.github/workflows/smoke_test_assets:/mnt/smoke -t cbmc jbmc --classpath /mnt/smoke Test
371+
- name: Smoke test goto-analyzer
372+
run: docker run -v ${PWD}/.github/workflows/smoke_test_assets:/mnt/smoke -t cbmc goto-analyzer /mnt/smoke/test.goto --unreachable-functions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
public class Test {
2+
public static void main(String[] args) {
3+
System.out.println("Hi");
4+
assert(1 == 1);
5+
}
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <assert.h>
2+
3+
#define return_val 0;
4+
5+
int main(void)
6+
{
7+
assert(1 == 1);
8+
return return_val;
9+
}

0 commit comments

Comments
 (0)