-
Notifications
You must be signed in to change notification settings - Fork 8
92 lines (83 loc) · 2.47 KB
/
run_unit_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: build and test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: Build and run tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cc: gcc
- os: macos-latest
cc: clang
- os: windows-latest
cc: clang
- os: windows-latest
cc: cl
steps:
- uses: actions/checkout@v4
- name: Install build and test dependencies (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
sudo apt-get update
sudo apt-get install -y --no-install-suggests --no-install-recommends \
build-essential \
check \
clang \
llvm \
meson \
pkg-config \
uthash-dev \
valgrind
sudo apt-get clean
- name: Install build and test dependencies (macOS)
if: startsWith(matrix.os, 'macos')
run: brew install check meson uthash
- name: Install build and test dependencies (Windows)
if: startsWith(matrix.os, 'windows')
run: pip install meson ninja
- name: Build and install library
shell: bash
run: |
export CC=${{ matrix.cc }}
sudo=
case "${{ matrix.os }}" in
ubuntu*)
sudo=sudo
;;
windows*)
case "${{ matrix.cc }}" in
cl)
# ignore CK_DIAGNOSTIC_POP warnings in check
setup_args="--vsenv -Dcheck:werror=false"
;;
clang)
# Ignore unused parameter warnings from check.h
export CFLAGS=-Wno-unused-parameter
# https://github.com/mesonbuild/meson/issues/10022
export CC_LD=lld-link
;;
esac
;;
esac
meson setup builddir --werror $setup_args
DEBUG_DICT=1 meson compile -C builddir
$sudo meson install -C builddir
- name: Run unit tests
# Don't run tests for private copy of Check
run: meson test -C builddir --suite libdicom
- name: Print unit test logs
if: always()
run: cat builddir/meson-logs/testlog.txt
- name: Run valgrind
if: startsWith(matrix.os, 'ubuntu')
run: |
valgrind --leak-check=full dcm-dump ./data/test_files/sm_image.dcm > /dev/null