diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml new file mode 100644 index 0000000..4376ff3 --- /dev/null +++ b/.github/workflows/clang-format.yml @@ -0,0 +1,17 @@ +name: test-clang-format +on: [push,pull_request] + +jobs: + clang-format-checking: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + - uses: DoozyX/clang-format-lint-action@v0.20 + with: + source: "." + exclude: "" + extensions: 'h,cpp' + style: file + clangFormatVersion: 20 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ba9a321..49c3a63 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -10,7 +10,7 @@ # supported CodeQL languages. # name: "CodeQL" -on: [push] +on: [push,pull_request] jobs: analyze: @@ -32,7 +32,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: install tools run: | diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml index 1b4b7fc..30842c3 100644 --- a/.github/workflows/cppcheck.yml +++ b/.github/workflows/cppcheck.yml @@ -5,14 +5,15 @@ jobs: build: name: cppcheck-test runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: cppcheck uses: deep5050/cppcheck-action@main with: - github_token: ${{ secrets.GITHUB_TOKEN}} - std: c++17 + std: c++20 inline_suppression: enable exclude_check: ./tests output_file: cppcheck_report.txt diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml index ac569fa..0d81c64 100644 --- a/.github/workflows/doxygen.yml +++ b/.github/workflows/doxygen.yml @@ -1,12 +1,14 @@ name: doxygen -on: [push] +on: [push,pull_request] jobs: build: name: doxygen-test runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'true' diff --git a/.github/workflows/i18n-check.yml b/.github/workflows/i18n-check.yml index 2a8b272..8139796 100644 --- a/.github/workflows/i18n-check.yml +++ b/.github/workflows/i18n-check.yml @@ -1,12 +1,14 @@ name: quneiform -on: [push] +on: [push,pull_request] jobs: build: name: quneiform runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install quneiform run: | diff --git a/.github/workflows/macos-unit-tests.yml b/.github/workflows/macos-unit-tests.yml index 64faac2..816fda1 100644 --- a/.github/workflows/macos-unit-tests.yml +++ b/.github/workflows/macos-unit-tests.yml @@ -1,12 +1,14 @@ name: macOS Build & Unit Tests -on: [push] +on: [push,pull_request] jobs: build: name: unit-tests runs-on: macos-latest + permissions: + contents: read steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: build & run tests run: | @@ -17,10 +19,10 @@ jobs: cmake ./ make -j4 cd bin - ./TETestRunner --reporter JUnit::out=TE-junit.xml - cat TE-junit.xml - errors=$(cat TE-junit.xml | ggrep -Po '(errors)="\K[^"]*') - failures=$(cat TE-junit.xml | ggrep -Po '(failures)="\K[^"]*') + ./TETestRunner --reporter JUnit::out=te-junit.xml + cat te-junit.xml + errors=$(cat te-junit.xml | ggrep -Po '(errors)="\K[^"]*') + failures=$(cat te-junit.xml | ggrep -Po '(failures)="\K[^"]*') echo "Error count is: ${errors}" echo "Failure count is: ${failures}" if [ "$errors" -gt 0 ]; then @@ -36,10 +38,10 @@ jobs: cmake -DTE_POW_FROM_RIGHT=1 ./ make -j4 cd bin - ./TETestRunner --reporter JUnit::out=TE-junit2.xml - cat TE-junit2.xml - errors=$(cat TE-junit2.xml | ggrep -Po '(errors)="\K[^"]*') - failures=$(cat TE-junit2.xml | ggrep -Po '(failures)="\K[^"]*') + ./TETestRunner --reporter JUnit::out=te-junit-pow-from-right.xml + cat te-junit-pow-from-right.xml + errors=$(cat te-junit-pow-from-right.xml | ggrep -Po '(errors)="\K[^"]*') + failures=$(cat te-junit-pow-from-right.xml | ggrep -Po '(failures)="\K[^"]*') echo "Error count is: ${errors}" echo "Failure count is: ${failures}" if [ "$errors" -gt 0 ]; then @@ -55,10 +57,10 @@ jobs: cmake -DTE_FLOAT=1 ./ make -j4 cd bin - ./TETestRunner --reporter JUnit::out=TE-junit2.xml - cat TE-junit2.xml - errors=$(cat TE-junit2.xml | ggrep -Po '(errors)="\K[^"]*') - failures=$(cat TE-junit2.xml | ggrep -Po '(failures)="\K[^"]*') + ./TETestRunner --reporter JUnit::out=te-junit-float.xml + cat te-junit-float.xml + errors=$(cat te-junit-float.xml | ggrep -Po '(errors)="\K[^"]*') + failures=$(cat te-junit-float.xml | ggrep -Po '(failures)="\K[^"]*') echo "Error count is: ${errors}" echo "Failure count is: ${failures}" if [ "$errors" -gt 0 ]; then @@ -74,10 +76,10 @@ jobs: cmake -DTE_LONG_DOUBLE=1 ./ make -j4 cd bin - ./TETestRunner --reporter JUnit::out=TE-junit2.xml - cat TE-junit2.xml - errors=$(cat TE-junit2.xml | ggrep -Po '(errors)="\K[^"]*') - failures=$(cat TE-junit2.xml | ggrep -Po '(failures)="\K[^"]*') + ./TETestRunner --reporter JUnit::out=te-junit-long-double.xml + cat te-junit-long-double.xml + errors=$(cat te-junit-long-double.xml | ggrep -Po '(errors)="\K[^"]*') + failures=$(cat te-junit-long-double.xml | ggrep -Po '(failures)="\K[^"]*') echo "Error count is: ${errors}" echo "Failure count is: ${failures}" if [ "$errors" -gt 0 ]; then @@ -93,10 +95,10 @@ jobs: cmake -DTE_BITWISE_OPERATORS=1 ./ make -j4 cd bin - ./TETestRunner --reporter JUnit::out=TE-junit2.xml - cat TE-junit2.xml - errors=$(cat TE-junit2.xml | ggrep -Po '(errors)="\K[^"]*') - failures=$(cat TE-junit2.xml | ggrep -Po '(failures)="\K[^"]*') + ./TETestRunner --reporter JUnit::out=te-junit-bitwise.xml + cat te-junit-bitwise.xml + errors=$(cat te-junit-bitwise.xml | ggrep -Po '(errors)="\K[^"]*') + failures=$(cat te-junit-bitwise.xml | ggrep -Po '(failures)="\K[^"]*') echo "Error count is: ${errors}" echo "Failure count is: ${failures}" if [ "$errors" -gt 0 ]; then @@ -105,3 +107,9 @@ jobs: if [ "$failures" -gt 0 ]; then exit 1 fi + + - name: Archive test results + uses: actions/upload-artifact@v4 + with: + name: macOS unit tests + path: ${{ github.workspace }}/tests/bin/*.xml \ No newline at end of file diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index 4f3a8d5..743c108 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -7,7 +7,7 @@ # https://github.com/microsoft/msvc-code-analysis-action name: Microsoft C++ Code Analysis -on: [push] +on: [push,pull_request] env: # Path to the CMake build directory. @@ -28,7 +28,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'true' diff --git a/.github/workflows/msw-unit-tests.yml b/.github/workflows/msw-unit-tests.yml index c575e25..3c019b7 100644 --- a/.github/workflows/msw-unit-tests.yml +++ b/.github/workflows/msw-unit-tests.yml @@ -1,5 +1,5 @@ name: Windows Build & Unit Tests -on: [push] +on: [push, pull_request] env: testrunner: 'TETestRunner' @@ -9,8 +9,10 @@ jobs: build: name: unit-tests runs-on: windows-latest + permissions: + contents: read steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'true' - run: git config --global core.autocrlf input @@ -48,9 +50,9 @@ jobs: cmake -DTE_POW_FROM_RIGHT = 1 ./ msbuild ${{ env.testrunner }}.sln cd bin\Debug - ./${{ env.testrunner }} --reporter JUnit::out=${{ env.outfile }} - cat ${{ env.outfile }} - $FileContent = Get-Content ${{ env.outfile }} + ./${{ env.testrunner }} --reporter JUnit::out=te-junit-pow-from-right.xml + cat te-junit-pow-from-right.xml + $FileContent = Get-Content te-junit-pow-from-right.xml $errors = (Select-String -InputObject $FileContent -Pattern 'errors="([0-9]+)"' | % { $($_.matches.groups[1]) } ) $failures = (Select-String -InputObject $FileContent -Pattern 'failures="([0-9]+)"' | % { $($_.matches.groups[1]) } ) if ($errors.Value -gt 0) @@ -70,9 +72,9 @@ jobs: cmake -DTE_FLOAT = 1 ./ msbuild ${{ env.testrunner }}.sln cd bin\Debug - ./${{ env.testrunner }} --reporter JUnit::out=${{ env.outfile }} - cat ${{ env.outfile }} - $FileContent = Get-Content ${{ env.outfile }} + ./${{ env.testrunner }} --reporter JUnit::out=te-junit-float.xml + cat te-junit-float.xml + $FileContent = Get-Content te-junit-float.xml $errors = (Select-String -InputObject $FileContent -Pattern 'errors="([0-9]+)"' | % { $($_.matches.groups[1]) } ) $failures = (Select-String -InputObject $FileContent -Pattern 'failures="([0-9]+)"' | % { $($_.matches.groups[1]) } ) if ($errors.Value -gt 0) @@ -92,9 +94,9 @@ jobs: cmake -DTE_LONG_DOUBLE = 1 ./ msbuild ${{ env.testrunner }}.sln cd bin\Debug - ./${{ env.testrunner }} --reporter JUnit::out=${{ env.outfile }} - cat ${{ env.outfile }} - $FileContent = Get-Content ${{ env.outfile }} + ./${{ env.testrunner }} --reporter JUnit::out=te-junit-long-double.xml + cat te-junit-long-double.xml + $FileContent = Get-Content te-junit-long-double.xml $errors = (Select-String -InputObject $FileContent -Pattern 'errors="([0-9]+)"' | % { $($_.matches.groups[1]) } ) $failures = (Select-String -InputObject $FileContent -Pattern 'failures="([0-9]+)"' | % { $($_.matches.groups[1]) } ) if ($errors.Value -gt 0) @@ -114,9 +116,9 @@ jobs: cmake -DTE_BITWISE_OPERATORS = 1 ./ msbuild ${{ env.testrunner }}.sln cd bin\Debug - ./${{ env.testrunner }} --reporter JUnit::out=${{ env.outfile }} - cat ${{ env.outfile }} - $FileContent = Get-Content ${{ env.outfile }} + ./${{ env.testrunner }} --reporter JUnit::out=te-junit-bitwise.xml + cat te-junit-bitwise.xml + $FileContent = Get-Content te-junit-bitwise.xml $errors = (Select-String -InputObject $FileContent -Pattern 'errors="([0-9]+)"' | % { $($_.matches.groups[1]) } ) $failures = (Select-String -InputObject $FileContent -Pattern 'failures="([0-9]+)"' | % { $($_.matches.groups[1]) } ) if ($errors.Value -gt 0) @@ -129,3 +131,9 @@ jobs: Write-Host "Failure count is: " + $failures.Value exit 1 } + + - name: Archive test results + uses: actions/upload-artifact@v4 + with: + name: MSW unit tests + path: ${{ github.workspace }}/tests/bin/Debug/*.xml \ No newline at end of file diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 4022a1f..a1b036a 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -1,14 +1,16 @@ name: Spell Check -on: [push] +on: [push,pull_request] jobs: check-unix: runs-on: ubuntu-latest + permissions: + contents: read name: Check Spelling steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install codespell run: | diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index b24adaf..857c03c 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -1,12 +1,14 @@ name: Linux Build & Unit Tests -on: [push] +on: [push, pull_request] jobs: build: name: unit-tests runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install tools run: | @@ -21,10 +23,10 @@ jobs: cmake ./ make -j4 cd bin - ./TETestRunner --reporter JUnit::out=TE-junit.xml - cat TE-junit.xml - errors=$(cat TE-junit.xml | grep -Po '(errors)="\K[^"]*') - failures=$(cat TE-junit.xml | grep -Po '(failures)="\K[^"]*') + ./TETestRunner --reporter JUnit::out=te-junit.xml + cat te-junit.xml + errors=$(cat te-junit.xml | grep -Po '(errors)="\K[^"]*') + failures=$(cat te-junit.xml | grep -Po '(failures)="\K[^"]*') echo "Error count is: ${errors}" echo "Failure count is: ${failures}" if [ "$errors" -gt 0 ]; then @@ -40,10 +42,10 @@ jobs: cmake -DTE_POW_FROM_RIGHT=1 ./ make -j4 cd bin - ./TETestRunner --reporter JUnit::out=TE-junit2.xml - cat TE-junit2.xml - errors=$(cat TE-junit2.xml | grep -Po '(errors)="\K[^"]*') - failures=$(cat TE-junit2.xml | grep -Po '(failures)="\K[^"]*') + ./TETestRunner --reporter JUnit::out=te-junit-pow-from-right.xml + cat te-junit-pow-from-right.xml + errors=$(cat te-junit-pow-from-right.xml | grep -Po '(errors)="\K[^"]*') + failures=$(cat te-junit-pow-from-right.xml | grep -Po '(failures)="\K[^"]*') echo "Error count is: ${errors}" echo "Failure count is: ${failures}" if [ "$errors" -gt 0 ]; then @@ -59,10 +61,10 @@ jobs: cmake -DTE_FLOAT=1 ./ make -j4 cd bin - ./TETestRunner --reporter JUnit::out=TE-junit2.xml - cat TE-junit2.xml - errors=$(cat TE-junit2.xml | grep -Po '(errors)="\K[^"]*') - failures=$(cat TE-junit2.xml | grep -Po '(failures)="\K[^"]*') + ./TETestRunner --reporter JUnit::out=te-junit-float.xml + cat te-junit-float.xml + errors=$(cat te-junit-float.xml | grep -Po '(errors)="\K[^"]*') + failures=$(cat te-junit-float.xml | grep -Po '(failures)="\K[^"]*') echo "Error count is: ${errors}" echo "Failure count is: ${failures}" if [ "$errors" -gt 0 ]; then @@ -78,10 +80,10 @@ jobs: cmake -DTE_LONG_DOUBLE=1 ./ make -j4 cd bin - ./TETestRunner --reporter JUnit::out=TE-junit2.xml - cat TE-junit2.xml - errors=$(cat TE-junit2.xml | grep -Po '(errors)="\K[^"]*') - failures=$(cat TE-junit2.xml | grep -Po '(failures)="\K[^"]*') + ./TETestRunner --reporter JUnit::out=te-junit-long-double.xml + cat te-junit-long-double.xml + errors=$(cat te-junit-long-double.xml | grep -Po '(errors)="\K[^"]*') + failures=$(cat te-junit-long-double.xml | grep -Po '(failures)="\K[^"]*') echo "Error count is: ${errors}" echo "Failure count is: ${failures}" if [ "$errors" -gt 0 ]; then @@ -97,10 +99,10 @@ jobs: cmake -DTE_BITWISE_OPERATORS=1 ./ make -j4 cd bin - ./TETestRunner --reporter JUnit::out=TE-junit2.xml - cat TE-junit2.xml - errors=$(cat TE-junit2.xml | grep -Po '(errors)="\K[^"]*') - failures=$(cat TE-junit2.xml | grep -Po '(failures)="\K[^"]*') + ./TETestRunner --reporter JUnit::out=te-junit-bitwise.xml + cat te-junit-bitwise.xml + errors=$(cat te-junit-bitwise.xml | grep -Po '(errors)="\K[^"]*') + failures=$(cat te-junit-bitwise.xml | grep -Po '(failures)="\K[^"]*') echo "Error count is: ${errors}" echo "Failure count is: ${failures}" if [ "$errors" -gt 0 ]; then @@ -110,4 +112,8 @@ jobs: exit 1 fi - + - name: Archive test results + uses: actions/upload-artifact@v4 + with: + name: Linux unit tests + path: ${{ github.workspace }}/tests/bin/*.xml diff --git a/.gitignore b/.gitignore index 55022ed..f24e1b0 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ CMakeSettings.json /docs/manual/.quarto /docs/search.json /docs/technical-overview_files/figure-pdf +/docs/images/cover.png +/docs/manual diff --git a/README.md b/README.md index c7c11f2..f6e6daa 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ for a full list of features. | ------------- | ------------- | | Doxygen | [](https://github.com/Blake-Madden/tinyexpr-plusplus/actions/workflows/doxygen.yml) | | Spellcheck | [](https://github.com/Blake-Madden/i18n-check/actions/workflows/spell-check.yml) | +| clang-format | [](https://github.com/Blake-Madden/tinyexpr-plusplus/actions/workflows/clang-format.yml) | ## Compatibility Advisory diff --git a/docs/Appendix.html b/docs/Appendix.html index 2b045a2..10de074 100644 --- a/docs/Appendix.html +++ b/docs/Appendix.html @@ -2,12 +2,12 @@
- + -