[pre-commit.ci] auto fixes from pre-commit.com hooks #300
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: cpp_build | |
on: [push, pull_request] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, macos-10.15] | |
python-version: [3.6, 3.7, 3.8] | |
exclude: | |
- os: macos-10.15 | |
python-version: 3.6 | |
- os: macos-10.15 | |
python-version: 3.7 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup CMake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: '3.18.x' | |
- name: Check CMake version | |
run: cmake --version | |
- name: Build C++ library | |
run: | | |
mkdir build/ | |
pushd build/ | |
cmake .. | |
make | |
popd | |
- name: Test C++ encode | |
run: | | |
encoding=($(./build/bin/example_encode 0x4235 16)) | |
echo "encode output: ${encoding[@]}" | |
# test encoded value | |
[ ${encoding[0]} = "0x8a3ac" ] | |
# test encoded length | |
[ ${encoding[1]} = "21" ] | |
- name: Test C++ decode | |
run: | | |
decoding=($(./build/bin/example_decode 0x8a3ac 21)) | |
echo "decode output: ${decoding[@]}" | |
# test decoded value | |
[ ${decoding[0]} = "0x4235" ] | |
# test decoded length | |
[ ${decoding[1]} = "16" ] | |
- name: Test C++ decode error correction | |
run: | | |
decoding=($(./build/bin/example_decode 0x8a1ac 21)) | |
echo "decode output: ${decoding[@]}" | |
# test decoded value | |
[ ${decoding[0]} = "0x4235" ] | |
# test decoded length | |
[ ${decoding[1]} = "16" ] |