Skip to content

Commit 14f2edf

Browse files
authored
Upgrade to newer ubuntu, podman & drop appveyor (#167)
* Upgrade to newer ubuntu, podman & drop appveyor * Minor bugfixes exposed by newer tools
1 parent 1e2f9df commit 14f2edf

11 files changed

Lines changed: 2273 additions & 759 deletions

File tree

.github/workflows/build_and_test.yml

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,30 @@ on:
99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12-
container:
13-
image: docker://andredesigna/pdfgen:latest
1412

1513
steps:
1614
- uses: actions/checkout@v6
1715
- name: Build Win32
18-
run: |
19-
make clean
20-
make CC=/usr/lib/mxe/usr/bin/i686-w64-mingw32.static-gcc CLANG_FORMAT=clang-format-10
21-
cp testprog testprog.exe
16+
run: make podman-build-win32
2217
- name: Infer
23-
run: make clean && infer run --no-progress-bar -- make CFLAGS="-g -Wall -pipe" LFLAGS="-lm"
18+
run: make podman-infer
2419
- name: Build
25-
run: make clean && make
26-
- name: Update coverage statistics
27-
shell: bash
28-
env:
29-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
30-
run: |
31-
if [[ "${GITHUB_REF##*/}" == "master" ]] ; then
32-
./testprog
33-
coveralls -i pdfgen.c
34-
fi
20+
run: make podman-build
3521
- name: Test
36-
run: make clean && scan-build-10 --status-bugs make check CLANG_FORMAT=clang-format-10
22+
run: make podman-test
3723
- name: Fuzz Test
38-
run: make fuzz-check CLANG=clang-10 CLANG_FORMAT=clang-format-10 -j8
24+
run: make podman-fuzz-check -j8
3925
- name: Docs
40-
run: make docs
26+
run: make podman-docs
4127
- name: Coverage
42-
run: make clean && make coverage
28+
env:
29+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
30+
GITHUB_REF: ${{ github.ref }}
31+
run: make podman-coverage
4332
- name: Upload artifacts
4433
uses: actions/upload-artifact@v4
4534
with:
46-
name: main-artifacts
35+
name: pdfgen-main-artifacts
4736
path: |
4837
output.pdf
4938
pdfgen.h
@@ -76,10 +65,10 @@ jobs:
7665
cp testprog.exe testprog-32.exe
7766
testprog-32
7867
cp output.pdf output-win32.pdf
79-
- name: Upload aritfacts
68+
- name: Upload artifacts
8069
uses: actions/upload-artifact@v4
8170
with:
82-
name: win32-artifacts
71+
name: pdfgen-win32-artifacts
8372
path: |
8473
output-win32.pdf
8574
output-win64.pdf

Dockerfile

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:24.04
22

33
ENV DEBIAN_FRONTEND noninteractive
44

55
RUN apt-get update && apt-get install -y dirmngr
6-
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 86B72ED9 \
7-
&& echo "deb http://mirror.mxe.cc/repos/apt xenial main" > /etc/apt/sources.list.d/mxeapt.list
86

9-
RUN dpkg --add-architecture i386
107
RUN apt-get update && apt-get install --no-install-recommends -y \
118
ca-certificates \
12-
clang-10 \
13-
clang-format-10 \
14-
clang-tools-10 \
9+
clang \
10+
clang-format \
11+
clang-tools \
1512
cloc \
1613
colordiff \
1714
cppcheck \
@@ -23,33 +20,29 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
2320
ghostscript \
2421
git \
2522
graphviz \
26-
libtinfo5 \
27-
llvm-10 \
23+
libclang-rt-dev \
24+
libtinfo6 \
25+
llvm \
2826
locales-all \
2927
make \
30-
mxe-i686-w64-mingw32.static-gcc \
28+
mingw-w64 \
3129
pdftk-java \
3230
poppler-utils \
33-
python2.7 \
31+
python3 \
3432
python3-pip \
3533
python3-setuptools \
3634
software-properties-common \
3735
tzdata \
3836
valgrind \
3937
vim \
38+
xxd \
4039
xz-utils \
4140
zbar-tools
4241

43-
RUN python3 -m pip install cpp-coveralls
42+
RUN python3 -m pip install --break-system-packages cpp-coveralls
4443

4544
# Install Infer
46-
RUN mkdir -p /opt && curl -L https://github.com/facebook/infer/releases/download/v1.0.0/infer-linux64-v1.0.0.tar.xz | tar -C /opt -x -J
47-
ENV PATH $PATH:/opt/infer-linux64-v1.0.0/bin/
48-
49-
# Install acroread
50-
RUN apt-get install -y --no-install-recommends \
51-
libgtk2.0-0:i386 \
52-
libxml2:i386
53-
RUN curl -L -O http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i486linux_enu.bin && chmod +x AdbeRdr9.5.5-1_i486linux_enu.bin && ./AdbeRdr9.5.5-1_i486linux_enu.bin --install_path=/opt
45+
RUN mkdir -p /opt && curl -L https://github.com/facebook/infer/releases/download/v1.2.0/infer-linux-x86_64-v1.2.0.tar.xz | tar -C /opt -x -J
46+
ENV PATH $PATH:/opt/infer-linux-x86_64-v1.2.0/bin/
5447

5548
RUN apt-get clean

Makefile

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ check: $(TESTPROG) pdfgen.c pdfgen.h example-check
4444
cppcheck --std=c99 --enable=style,warning,performance,portability,unusedFunction --quiet pdfgen.c pdfgen.h tests/main.c
4545
$(CXX) -c pdfgen.c $(CFLAGS_OBJECT) /dev/null -Werror -Wall -Wextra
4646
./tests/tests.sh
47-
./tests/tests.sh acroread
4847
$(CLANG_FORMAT) pdfgen.c | colordiff -u pdfgen.c -
4948
$(CLANG_FORMAT) pdfgen.h | colordiff -u pdfgen.h -
5049
$(CLANG_FORMAT) tests/main.c | colordiff -u tests/main.c -
@@ -56,26 +55,56 @@ coverage: $(TESTPROG)
5655
mkdir coverage-html
5756
gcovr -r . --html --html-details -o coverage-html/coverage.html
5857

59-
example-check: FORCE
58+
example-check:
6059
# Extract the code block from the README & make sure it compiles
6160
sed -n '/^```/,/^```/ p' < README.md | sed '/^```/ d' > example-check.c
6261
$(CC) $(CFLAGS) -o example-check example-check.c pdfgen.c $(LFLAGS)
6362
rm example-check example-check.c
6463

65-
check-fuzz-%: tests/fuzz-% FORCE
64+
check-fuzz-%: tests/fuzz-%
6665
mkdir -p fuzz-artifacts
6766
./$< -verbosity=0 -max_total_time=240 -max_len=8192 -rss_limit_mb=1024 -artifact_prefix="./fuzz-artifacts/"
6867

6968
fuzz-check: check-fuzz-image-data check-fuzz-image-file check-fuzz-header check-fuzz-text check-fuzz-dstr check-fuzz-barcode check-fuzz-ttf
7069

71-
format: FORCE
70+
format:
7271
$(CLANG_FORMAT) -i pdfgen.c pdfgen.h tests/main.c tests/fuzz-*.c tests/massive-file.c
7372

74-
docs: FORCE
73+
docs:
7574
doxygen docs/pdfgen.dox 2>&1 | tee doxygen.log
7675
cat doxygen.log | test `wc -c` -le 0
7776

78-
FORCE:
77+
podman-image:
78+
podman build -t pdfgen .
79+
80+
podman-build-win32: podman-image
81+
podman run --rm -v $(PWD):/src -w /src pdfgen bash -c 'make clean && make CC=x86_64-w64-mingw32-gcc'
82+
83+
podman-infer: podman-image
84+
podman run --rm -v $(PWD):/src -w /src pdfgen bash -c 'make clean && infer run --no-progress-bar -- make CFLAGS="-g -Wall -pipe" LFLAGS="-lm"'
85+
86+
podman-build: podman-image
87+
podman run --rm -v $(PWD):/src -w /src pdfgen bash -c 'make clean && make'
88+
89+
podman-test: podman-image
90+
podman run --rm -v $(PWD):/src -w /src pdfgen bash -c 'make clean && scan-build --status-bugs make check'
91+
92+
podman-check: podman-image
93+
podman run --rm -v $(PWD):/src -w /src pdfgen bash -c 'make clean && make check'
94+
95+
podman-fuzz-check: podman-image
96+
podman run --rm -v $(PWD):/src -w /src pdfgen bash -c 'make clean && make fuzz-check -j8'
97+
98+
podman-docs: podman-image
99+
podman run --rm -v $(PWD):/src -w /src pdfgen make docs
100+
101+
podman-coverage: podman-image
102+
podman run --rm -v $(PWD):/src -w /src -e COVERALLS_REPO_TOKEN=$(COVERALLS_REPO_TOKEN) -e GITHUB_REF=$(GITHUB_REF) pdfgen bash -c 'make clean && make coverage && if [ "$$(basename "$${GITHUB_REF:-none}")" = "master" ]; then ./testprog && coveralls -i pdfgen.c; fi'
103+
104+
podman-shell: podman-image
105+
podman run -i -t --rm -v $(PWD):/src -w /src pdfgen /bin/bash
106+
107+
.PHONY: default check coverage example-check fuzz-check format docs podman-image podman-build-win32 podman-infer podman-build podman-test podman-check podman-fuzz-check podman-docs podman-coverage podman-shell clean
79108

80109
clean:
81110
rm -f *$(O_SUFFIX) tests/*$(O_SUFFIX) $(TESTPROG) *.gcda *.gcno *.gcov tests/*.gcda tests/*.gcno output.pdf output.txt tests/fuzz-header tests/fuzz-text tests/fuzz-image-data tests/fuzz-image-file test/massive-file output.pdftk fuzz-image-file.pdf fuzz-image-data.pdf fuzz-image.dat doxygen.log tests/penguin.c fuzz.pdf output.ps output.ppm output-barcodes.txt

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ Builds
6262
======
6363
Build status: [![GitHub Actions](https://github.com/AndreRenaud/PDFGen/workflows/Build%20and%20Test/badge.svg)](https://github.com/AndreRenaud/PDFGen/actions)
6464
65-
Appveyor status: [![Build status](https://ci.appveyor.com/api/projects/status/3qpsmr06xg5gx74j/branch/master?svg=true)](https://ci.appveyor.com/project/AndreRenaud/pdfgen/branch/master)
66-
6765
Code Coverage: [![Coverage Status](https://coveralls.io/repos/github/AndreRenaud/PDFGen/badge.svg?branch=master)](https://coveralls.io/github/AndreRenaud/PDFGen?branch=master)
6866
6967
Coverity scan: [![Coverity scan](https://scan.coverity.com/projects/11942/badge.svg)](https://scan.coverity.com/projects/andrerenaud-pdfgen)

appveyor.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

docker-launch.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)