Skip to content

Commit 7238625

Browse files
committed
Add github action testing the latest debian package by running unit tests against it
1 parent 3103b17 commit 7238625

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Run release tests
2+
3+
on:
4+
push: # remove that after testing this action
5+
release:
6+
types:
7+
- released
8+
9+
jobs:
10+
build-and-run-release-tests:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Build release test Docker image
15+
uses: docker/build-push-action@v6
16+
with:
17+
push: false
18+
tags: |
19+
ghcr.io/kit-mrt/util_caching_release_tests
20+
target: release_test
21+
22+
- name: Run unit tests with/against released version
23+
run: |
24+
docker run --rm ghcr.io/kit-mrt/util_caching_release_tests
25+

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,27 @@ RUN cmake .. && \
4646

4747

4848

49+
FROM base AS release_test
50+
51+
# This downloads the latest util_caching debian release and adds it to the docker image
52+
# This "bloats" the image. But otherwise, we'd have to installing wget and ca-certificates
53+
# temporarily to download and install the package in one docker layer…
54+
ADD https://github.com/KIT-MRT/util_caching/releases/latest/download/libutil-caching-dev.deb /tmp/debfiles/
55+
56+
# Install util_caching from release debian package
57+
RUN dpkg -i /tmp/debfiles/*.deb && \
58+
rm -rf /tmp/debfiles
59+
60+
COPY test /tmp/util_caching_test
61+
WORKDIR /tmp/util_caching_test/build
62+
63+
RUN cmake .. && \
64+
cmake --build . -j9
65+
66+
CMD ["cmake", "--build", ".", "--target", "test"]
67+
68+
69+
4970
FROM base AS install
5071

5172
# Install util_caching

0 commit comments

Comments
 (0)