Fix serialization performance bottleneck and bump version to 0.2.6 #190
This file contains hidden or 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: C/C++ CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| test: | |
| name: Build and Test (Ubuntu) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: build and test | |
| run: g++ -std=c++20 -O3 -Iexternal/googletest/googletest/include -Iexternal/googletest/googletest src/TinyJSON.cpp tests/*.cpp external/googletest/googletest/src/gtest-all.cc -pthread -o testtinyjson | |
| - name: run tests | |
| run: | | |
| set +e | |
| ./testtinyjson | |
| windows-test: | |
| name: Build and Test (Windows) | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: setup MSYS2 and install GCC | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW64 | |
| install: mingw-w64-x86_64-gcc | |
| update: true | |
| release: true | |
| - name: build and test | |
| shell: msys2 {0} | |
| run: | | |
| g++ -std=c++20 -O3 \ | |
| -Iexternal/googletest/googletest/include \ | |
| -Iexternal/googletest/googletest \ | |
| src/TinyJSON.cpp tests/*.cpp \ | |
| external/googletest/googletest/src/gtest-all.cc \ | |
| -pthread \ | |
| -o testtinyjson.exe | |
| - name: run tests | |
| shell: msys2 {0} | |
| run: | | |
| ./testtinyjson.exe | |
| warnings: | |
| name: Build Warnings as Errors | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: build basic with warnings | |
| run: g++ -std=c++20 -Wall -Wextra -Werror -O3 src/TinyJSON.cpp example/basic_parse.cpp -o basic_parse | |
| - name: run basic with warnings | |
| run: | | |
| set +e | |
| ./basic_parse | |
| build20: | |
| name: Build C++ 20 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: build basic | |
| run: g++ -std=c++20 src/TinyJSON.cpp example/basic_parse.cpp -o basic_parse | |
| - name: run basic | |
| run: | | |
| set +e | |
| ./basic_parse | |
| - name: build options | |
| run: g++ -std=c++20 src/TinyJSON.cpp example/options.cpp -o options | |
| - name: run options | |
| run: | | |
| set +e | |
| ./options | |
| - name: user literals | |
| run: g++ -std=c++20 src/TinyJSON.cpp example/user_literals.cpp -o user_literals | |
| - name: run user literals | |
| run: | | |
| set +e | |
| ./user_literals | |
| build11: | |
| name: Build C++ 11 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: build options c++11 | |
| run: g++ -std=c++11 src/TinyJSON.cpp example/options11.cpp -o options11 | |
| - name: run options11 | |
| run: | | |
| set +e | |
| ./options11 | |
| build_array: | |
| name: Build array | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: build custom array c++11 | |
| run: g++ -std=c++11 -D TJ_INCLUDE_STDVECTOR=0 -Wall -Wextra -Werror -O3 src/TinyJSON.cpp example/basic_parse.cpp -o basic_parse | |
| - name: run custom array | |
| run: | | |
| set +e | |
| ./basic_parse | |
| - name: build std::vector c++11 | |
| run: g++ -std=c++11 -D TJ_INCLUDE_STDVECTOR=1 -Wall -Wextra -Werror -O3 src/TinyJSON.cpp example/basic_parse.cpp -o basic_parse | |
| - name: run std::vector | |
| run: | | |
| set +e | |
| ./basic_parse | |
| fast_dump: | |
| name: Fast dump test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: build fast dump c++11 | |
| run: g++ -std=c++11 -Wall -Wextra -Werror -O3 src/TinyJSON.cpp example/fast_dump.cpp -o fast_dump | |
| - name: run fast dump c++11 | |
| run: | | |
| set +e | |
| ./fast_dump | |
| - name: build fast dump c++20 | |
| run: g++ -std=c++20 -Wall -Wextra -Werror -O3 src/TinyJSON.cpp example/fast_dump.cpp -o fast_dump | |
| - name: run fast dump c++20 | |
| run: | | |
| set +e | |
| ./fast_dump | |