-
Notifications
You must be signed in to change notification settings - Fork 1
156 lines (115 loc) · 3.89 KB
/
gs1syntaxdictionary.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: GS1 Syntax Dictionary CI
on:
push:
pull_request:
jobs:
#
# CI jobs
#
ci-clang:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: clang CI
run: |
# For llvm-symbolizer
sudo apt-get -y --no-install-recommends install llvm
make -C src -j `nproc` test CC=clang SANITIZE=yes SLOW_TESTS=yes
make -C src -j `nproc` lib CC=clang SANITIZE=yes
ci-gcc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: gcc CI
run: |
make -C src -j `nproc` test CC=gcc SLOW_TESTS=yes
make -C src -j `nproc` lib CC=gcc
ci-msvc:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: MSVC CI
working-directory: src
run: |
msbuild /t:Restore,Build /p:Configuration=release /p:Platform="x86" /warnaserror gs1syntaxdictionary.sln
build\test\Win32\Release\gs1syntaxdictionary-test.exe
ci-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: clang CI
run: |
make -C src -j `sysctl -n hw.logicalcpu` test SANITIZE=noleak SLOW_TESTS=yes
make -C src -j `sysctl -n hw.logicalcpu` lib SANITIZE=noleak
ci-scan-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: clang static analyser CI
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install clang-tools
scan-build -o plist make -C src -j `nproc` test CC=clang SLOW_TESTS=yes
scan-build -o plist make -C src -j `nproc` lib CC=clang
[ "$(find plist/ -name *.html)" = '' ];
- name: "clang static analyzer: Store assets on failure"
uses: actions/upload-artifact@v3
with:
name: clang-scan.tgz
path: plist/**/*.html
retention-days: 30
if: ${{ failure() }}
- name: check includes for the linters with IWYU
working-directory: src
run: |
sudo apt-get -y --no-install-recommends install iwyu
find -name 'lint_*.c' -print0 | xargs -0 -n1 -i bash -c 'iwyu -DUNIT_TESTS -DGS1_LINTER_ERR_STR_EN {}; [[ $? = 2 ]] || false'
- name: cppcheck
working-directory: src
run: |
sudo apt-get -y --no-install-recommends install cppcheck
cppcheck --enable=all --force \
-U GS1_LINTER_CUSTOM_GCP_LOOKUP \
-U GS1_LINTER_CUSTOM_GCP_LOOKUP_H \
-U GS1_LINTER_CUSTOM_ISO4217_LOOKUP \
-U GS1_LINTER_CUSTOM_ISO4217_LOOKUP_H \
-U GS1_LINTER_CUSTOM_ISO3166ALPHA2_LOOKUP \
-U GS1_LINTER_CUSTOM_ISO3166ALPHA2_LOOKUP_H \
-U GS1_LINTER_CUSTOM_ISO3166_LOOKUP \
-U GS1_LINTER_CUSTOM_ISO3166_LOOKUP_H \
-U GS1_LINTER_CUSTOM_MEDIA_TYPE_LOOKUP \
-U GS1_LINTER_CUSTOM_MEDIA_TYPE_LOOKUP_H \
-U GS1_LINTER_CUSTOM_PACKAGE_TYPE_LOOKUP \
-U GS1_LINTER_CUSTOM_PACKAGE_TYPE_LOOKUP_H \
-U CLOCK_MONOTONIC -U RUNNING_ON_VALGRIND -U TEST_FINI -U TEST_INIT \
--suppress=missingIncludeSystem -i gs1syntaxdictionary-fuzzer-linters.c .
#
# Create a release for each tagged commit
#
create-release:
if: startsWith(github.ref, 'refs/tags/')
needs:
- ci-clang
- ci-gcc
- ci-msvc
- ci-macos
- ci-scan-build
runs-on: ubuntu-latest
steps:
- name: Get version
id: get_version
run: |
VERSION=${GITHUB_REF/refs\/tags\//}
echo ::set-output name=VERSION::$VERSION
- name: Create GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: ${{ steps.get_version.outputs.VERSION }}
draft: true
prerelease: false