Skip to content

Update ci

Update ci #272

Workflow file for this run

# ------------------------------------------------------------------------------
# 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-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/checkout@v1
- uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.4
- 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.4
- 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"