-
Notifications
You must be signed in to change notification settings - Fork 9
197 lines (196 loc) · 7.46 KB
/
xxd.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# ------------------------------------------------------------------------------
# Copyright Christopher Kormanyos 2022 - 2024.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------
name: xxd
on:
push:
branches:
- '**'
pull_request:
jobs:
gcc-clang-native:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
compiler: [ g++, clang++ ]
standard: [ c99, c11, c2x ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: install dos2unix
run: sudo apt install dos2unix
- name: gcc-clang-native
run: |
echo "query GCC version"
g++ -v
echo "build xxd"
echo '${{ matrix.compiler }}++ -x c -std=${{ matrix.standard }} -O3 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion src/xxd.c -o xxd.exe'
${{ matrix.compiler }} -x c -std=${{ matrix.standard }} -O3 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion src/xxd.c -o xxd
echo 'ls -la ./xxd'
ls -la ./xxd
echo 'create zero_a.bin'
echo "010000: 41" | xxd -r > zero_a.bin
echo 'sha1sum zero_a.bin | grep e534caeb1e149b6bc61ea48cf59861c7e15caa63'
sha1sum zero_a.bin | grep e534caeb1e149b6bc61ea48cf59861c7e15caa63
echo 'test with doc/xxd.1'
./xxd -l 120 -c 12 ./doc/xxd.1 | grep 'Tony Nugent'
./xxd -l 120 -c 12 ./doc/xxd.1 > xxd.1.txt
echo 'unix2dos xxd.1.txt'
unix2dos xxd.1.txt
echo 'sha1sum xxd.1.txt | grep b271bc7fc3716a44830bc33ee3a8313c0d3ab7f7'
sha1sum xxd.1.txt | grep b271bc7fc3716a44830bc33ee3a8313c0d3ab7f7
echo 'test2 with doc/xxd.1'
./xxd -s 0x36 -l 13 -c 13 ./doc/xxd.1 | grep '21st May 1996'
echo 'create a 3-byte abc-file'
echo "0:61 1:62 2:63" | xxd -r > abc.bin
sha1sum abc.bin | grep a9993e364706816aba3e25717850c26c9cd0d89d
gcc-clang-native-with-artifact:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: gcc-clang-native-with-artifact
run: |
echo "query GCC version"
g++ -v
echo "build xxd"
echo 'g++ -x c -std=c11 -O3 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion src/xxd.c -o xxd.exe'
g++ -x c -std=c11 -O3 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion src/xxd.c -o xxd
echo 'ls -la ./xxd'
ls -la ./xxd
- uses: actions/upload-artifact@v4
with:
name: xxd-x86_64-linux-gnu
path: ./xxd
clang-macos-native-with-artifact:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: clang-macos-native-with-artifact
run: |
echo "query clang version"
clang++ -v
echo "build xxd"
echo 'clang++ -x c -std=c11 -O2 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion src/xxd.c -o xxd.exe'
clang++ -x c -std=c11 -O2 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion src/xxd.c -o xxd
echo 'ls -la ./xxd'
ls -la ./xxd
- uses: actions/upload-artifact@v4
with:
name: xxd-macos
path: ./xxd
msvc-release-x64:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/checkout@v1
- uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.2
- name: msvc-release-x64
shell: cmd
working-directory: ./
run: |
MSBuild -m xxd.sln -p:useenv=true -p:Configuration=Release -p:Platform=x64 /t:Rebuild
dir %cd%\x64\Release\xxd.exe
cd %cd%\x64\Release
echo "create zero_a.bin"
echo "010000: 41" | xxd -r > zero_a.bin
certutil -hashfile "zero_a.bin" SHA1 | findstr "e534caeb1e149b6bc61ea48cf59861c7e15caa63"
echo test with ../../doc/xxd.1
.\xxd -l 120 -c 12 ..\..\doc\xxd.1 | findstr "Tony Nugent"
.\xxd -l 120 -c 12 ..\..\doc\xxd.1 > xxd.1.txt
certutil -hashfile "xxd.1.txt" SHA1 | findstr "b271bc7fc3716a44830bc33ee3a8313c0d3ab7f7"
echo test2 with ../../doc/xxd.1
.\xxd -s 0x36 -l 13 -c 13 ..\..\doc\xxd.1 | findstr "21st May 1996"
echo create a 3-byte abc-file
echo 0:61 1:62 2:63 | xxd -r > abc.bin
certutil -hashfile "abc.bin" SHA1 | findstr "a9993e364706816aba3e25717850c26c9cd0d89d"
- uses: actions/upload-artifact@v4
with:
name: xxd-win64-msvc
path: x64/Release/xxd.exe
ubuntu-latest-cmake-ninja:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: install tools
run: sudo apt install dos2unix ninja-build
- name: ubuntu-latest-cmake-ninja
run: |
echo "query GCC version"
g++ -v
echo "build xxd"
echo build xxd
mkdir build
cd build
cmake .. -G Ninja && ninja
echo 'ls -la ./xxd'
ls -la ./xxd
echo 'create zero_a.bin'
echo "010000: 41" | xxd -r > zero_a.bin
echo 'sha1sum zero_a.bin | grep e534caeb1e149b6bc61ea48cf59861c7e15caa63'
sha1sum zero_a.bin | grep e534caeb1e149b6bc61ea48cf59861c7e15caa63
echo 'test with doc/xxd.1'
./xxd -l 120 -c 12 ../doc/xxd.1 | grep 'Tony Nugent'
./xxd -l 120 -c 12 ../doc/xxd.1 > xxd.1.txt
echo 'unix2dos xxd.1.txt'
unix2dos xxd.1.txt
echo 'sha1sum xxd.1.txt | grep b271bc7fc3716a44830bc33ee3a8313c0d3ab7f7'
sha1sum xxd.1.txt | grep b271bc7fc3716a44830bc33ee3a8313c0d3ab7f7
echo 'test2 with doc/xxd.1'
./xxd -s 0x36 -l 13 -c 13 ../doc/xxd.1 | grep '21st May 1996'
echo 'create a 3-byte abc-file'
echo "0:61 1:62 2:63" | xxd -r > abc.bin
sha1sum abc.bin | grep a9993e364706816aba3e25717850c26c9cd0d89d
windows-latest-cmake-ninja:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.2
- name: gcc-clang-native-cmake-ninja
shell: cmd
run: |
echo build xxd
mkdir build
cd build
cmake .. -G Ninja && ninja
dir .\xxd.exe
echo "create zero_a.bin"
echo "010000: 41" | xxd -r > zero_a.bin
certutil -hashfile "zero_a.bin" SHA1 | findstr "e534caeb1e149b6bc61ea48cf59861c7e15caa63"
echo test with ../../doc/xxd.1
.\xxd -l 120 -c 12 ..\..\doc\xxd.1 | findstr "Tony Nugent"
.\xxd -l 120 -c 12 ..\..\doc\xxd.1 > xxd.1.txt
certutil -hashfile "xxd.1.txt" SHA1 | findstr "b271bc7fc3716a44830bc33ee3a8313c0d3ab7f7"
echo test2 with ../../doc/xxd.1
.\xxd -s 0x36 -l 13 -c 13 ..\..\doc\xxd.1 | findstr "21st May 1996"
echo create a 3-byte abc-file
echo 0:61 1:62 2:63 | xxd -r > abc.bin
certutil -hashfile "abc.bin" SHA1 | findstr "a9993e364706816aba3e25717850c26c9cd0d89d"