Skip to content

Commit 6c35cef

Browse files
committed
chore: Add a compcert docker run script.
Useful for local runs. Does the same as CI, so if it fails on CI, this can be used to test locally, avoiding slow CI round trips.
1 parent 41e6ea8 commit 6c35cef

File tree

3 files changed

+62
-46
lines changed

3 files changed

+62
-46
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,44 @@ jobs:
6060
with:
6161
file: other/docker/misra/Dockerfile
6262

63-
cimplefmt:
63+
build-nacl:
6464
runs-on: ubuntu-latest
6565
steps:
66-
- uses: actions/checkout@v2
66+
- name: Set up Docker Buildx
67+
uses: docker/setup-buildx-action@v1
68+
- name: Docker Build
69+
uses: docker/build-push-action@v2
6770
with:
68-
submodules: recursive
69-
- name: Run cimplefmt
70-
run: other/docker/cimplefmt/run -u $(find tox* -name "*.[ch]")
71+
file: other/docker/autotools/Dockerfile
7172

72-
build-nacl:
73+
build-tcc:
7374
runs-on: ubuntu-latest
7475
steps:
7576
- name: Set up Docker Buildx
7677
uses: docker/setup-buildx-action@v1
7778
- name: Docker Build
7879
uses: docker/build-push-action@v2
7980
with:
80-
file: other/docker/autotools/Dockerfile
81+
file: other/docker/tcc/Dockerfile
82+
83+
build-compcert:
84+
runs-on: ubuntu-latest
85+
steps:
86+
- name: Set up Docker Buildx
87+
uses: docker/setup-buildx-action@v1
88+
- name: Docker Build
89+
uses: docker/build-push-action@v2
90+
with:
91+
file: other/docker/compcert/Dockerfile
92+
93+
cimplefmt:
94+
runs-on: ubuntu-latest
95+
steps:
96+
- uses: actions/checkout@v2
97+
with:
98+
submodules: recursive
99+
- name: Run cimplefmt
100+
run: other/docker/cimplefmt/run -u $(find tox* -name "*.[ch]")
81101

82102
build-win32:
83103
runs-on: ubuntu-latest
@@ -125,45 +145,6 @@ jobs:
125145
- name: Build, test, and upload coverage
126146
run: .github/scripts/coverage-linux
127147

128-
build-tcc:
129-
runs-on: ubuntu-latest
130-
steps:
131-
- name: Set up Docker Buildx
132-
uses: docker/setup-buildx-action@v1
133-
- name: Docker Build
134-
uses: docker/build-push-action@v2
135-
with:
136-
file: other/docker/tcc/Dockerfile
137-
138-
build-compcert:
139-
runs-on: ubuntu-latest
140-
container: toxchat/compcert
141-
steps:
142-
- uses: actions/checkout@v2
143-
with:
144-
submodules: recursive
145-
- name: Build with CompCert
146-
run:
147-
ccomp
148-
-o send_message_test
149-
-Wall -Werror
150-
-Wno-c11-extensions
151-
-Wno-unknown-pragmas
152-
-Wno-unused-variable
153-
-fstruct-passing -fno-unprototyped -g
154-
auto_tests/auto_test_support.c
155-
auto_tests/send_message_test.c
156-
testing/misc_tools.c
157-
toxav/*.c
158-
toxcore/*.c
159-
toxcore/*/*.c
160-
toxencryptsave/*.c
161-
third_party/cmp/*.c
162-
-D__COMPCERT__ -DDISABLE_VLA -Dinline=
163-
-lpthread $(pkg-config --cflags --libs libsodium opus vpx)
164-
- name: Run the test
165-
run: "./send_message_test | grep 'tox clients connected'"
166-
167148
build-android:
168149
runs-on: ubuntu-latest
169150
steps:

other/docker/compcert/Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM toxchat/compcert:latest
2+
3+
WORKDIR /work
4+
COPY auto_tests/ /work/auto_tests/
5+
COPY testing/ /work/testing/
6+
COPY toxav/ /work/toxav/
7+
COPY toxcore/ /work/toxcore/
8+
COPY toxencryptsave/ /work/toxencryptsave/
9+
COPY third_party/ /work/third_party/
10+
11+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
12+
13+
RUN ccomp \
14+
-o send_message_test \
15+
-Wall -Werror \
16+
-Wno-c11-extensions \
17+
-Wno-unknown-pragmas \
18+
-Wno-unused-variable \
19+
-fstruct-passing -fno-unprototyped -g \
20+
auto_tests/auto_test_support.c \
21+
auto_tests/send_message_test.c \
22+
testing/misc_tools.c \
23+
toxav/*.c \
24+
toxcore/*.c \
25+
toxcore/*/*.c \
26+
toxencryptsave/*.c \
27+
third_party/cmp/*.c \
28+
-D__COMPCERT__ -DDISABLE_VLA -Dinline= \
29+
-lpthread $(pkg-config --cflags --libs libsodium opus vpx) \
30+
&& ./send_message_test | grep 'tox clients connected'

other/docker/compcert/run

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
set -eux
4+
5+
docker build -t toxchat/c-toxcore:compcert -f other/docker/compcert/Dockerfile .

0 commit comments

Comments
 (0)