diff --git a/.github/actions/setup_cache/action.yml b/.github/actions/setup_cache/action.yml new file mode 100644 index 000000000..ae49a2b6c --- /dev/null +++ b/.github/actions/setup_cache/action.yml @@ -0,0 +1,34 @@ + +name: 'setup_cache' +description: 'sets up the shared cache' +inputs: + compiler: + required: true + type: string + build_type: + required: true + type: string + generator: + required: true + type: string + developer_mode: + required: true + type: string + + +runs: + using: "composite" + steps: + - name: Cache + uses: actions/cache@v2 + with: + # You might want to add .ccache to your cache configuration? + path: | + ~/.cache/pip + ${{ env.HOME }}/.cache/vcpkg/archives + ${{ env.XDG_CACHE_HOME }}/vcpkg/archives + ${{ env.LOCALAPPDATA }}\vcpkg\archives + ${{ env.APPDATA }}\vcpkg\archives + key: ${{ runner.os }}-${{ inputs.compiler }}-${{ inputs.build_type }}-${{ inputs.generator }}-${{ inputs.developer_mode }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('./vcpkg.json')}} + restore-keys: | + ${{ runner.os }}-${{ inputs.compiler }}-${{ inputs.build_type }} diff --git a/.github/workflows/benchmark-and-deploy.yaml b/.github/workflows/benchmark-and-deploy.yaml index 40f47717f..7c2f95cd0 100644 --- a/.github/workflows/benchmark-and-deploy.yaml +++ b/.github/workflows/benchmark-and-deploy.yaml @@ -1,20 +1,20 @@ -run-name: Benchmark & Deploy / ${{ github.event.head_commit.message }} +run-name: Benchmark & Deploy name: Benchmark & Deploy on: - workflow_dispatch: - push: - pull_request: - types: [opened] - pull_request_target: - branches: - - "*" - + workflow_call: + inputs: + branch: + description: 'Branch ref' + required: true + default: 'main' + type: string jobs: cppcheck: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: + ref: ${{ inputs.branch }} submodules: 'recursive' - name: Install CppCheck run: | @@ -32,8 +32,9 @@ jobs: doxygen: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: + ref: ${{ inputs.branch }} submodules: 'recursive' - name: Configure shell: bash @@ -52,7 +53,7 @@ jobs: matrix: os: [ubuntu-latest] port: [8888] - server: [ac++-O, ac++-O1, ac++-O2, ac++-O3, ac++-Ofast, ac++-Og, ac++-Os, c++-O, c++-O1, c++-O2, c++-O3, c++-Ofast, c++-Og, c++-Os, python, node] + server: [ac++-O] #, ac++-O1, ac++-O2, ac++-O3, ac++-Ofast, ac++-Og, ac++-Os, c++-O, c++-O1, c++-O2, c++-O3, c++-Ofast, c++-Og, c++-Os] # , python, node] name: ${{ matrix.os }}-${{ matrix.server }} runs-on: ${{ matrix.os }} steps: @@ -66,8 +67,9 @@ jobs: echo "optimization=$optimization" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: + ref: ${{ inputs.branch }} submodules: 'recursive' - name: Install dependencies on ubuntu if: startsWith(matrix.server, 'c++') || startsWith(matrix.server, 'ac++') @@ -121,8 +123,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: + ref: ${{ inputs.branch }} submodules: 'recursive' - name: Download all artifacts 🔧 uses: actions/download-artifact@v3 @@ -151,35 +154,41 @@ jobs: needs: [cppcheck, doxygen, benchmark] steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: + ref: gh-pages submodules: 'recursive' - name: Download all artifacts 🔧 uses: actions/download-artifact@v3 - name: Prepare shell: bash run: | - rm -rf ./reports - mkdir -p ./reports/benchmark ./reports/docs ./reports/codeql_report - mv -f ./cppcheck/* reports/codeql_report/ - mv -f ./doxygen/* reports/docs/ - mv -f ./benchmark_report/* ./reports/benchmark/ + echo "${{ inputs.branch }}" >> branches.txt + cat branches.txt | sort | uniq > branches.txt + rm -rf ./${{ inputs.branch }}/reports + mkdir -p ./${{ inputs.branch }}/reports/benchmark ./${{ inputs.branch }}/reports/docs ./${{ inputs.branch }}/reports/codeql_report + mv -f ./cppcheck/* ./${{ inputs.branch }}/reports/codeql_report/ + mv -f ./doxygen/* ./${{ inputs.branch }}/reports/docs/ + mv -f ./benchmark_report/* ./${{ inputs.branch }}/reports/benchmark/ - name: Commit the reports shell: bash run: | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" - git add reports/ + git add ./${{ inputs.branch }} git commit -m "Pipeline reports" - name: Push pipeline reports uses: ad-m/github-push-action@master with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.ref }} - - name: Deploy to GitHub Pages 🚀 - continue-on-error: true - if: ${{ always() && github.ref == 'refs/heads/master' }} - uses: JamesIves/github-pages-deploy-action@v4.2.5 + github_token: ${{ github.token }} + branch: gh-pages + trigger: + needs: [deploy] + runs-on: ubuntu-latest + name: "📦 Trigger update doc" + steps: + - uses: passeidireto/trigger-external-workflow-action@main with: - branch: gh-pages # The branch the action should deploy to. - folder: ./reports # The folder the action should deploy. + repository: WebFrame/webframe.github.io + event: doc_update + github_pat: ${{ secrets.PERSONAL_ACCESS_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8685f33b2..2fa9f8dc0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,12 +43,12 @@ jobs: compiler: gcc-11 generator: "Ninja Multi-Config" build_type: Release - + - os: windows-2022 compiler: gcc-11 generator: "Ninja Multi-Config" build_type: Release - + - os: windows-2019 compiler: gcc-11 generator: "Ninja Multi-Config" @@ -153,16 +153,16 @@ jobs: ${{ env.XDG_CACHE_HOME }}/vcpkg/archives ${{ env.LOCALAPPDATA }}\vcpkg\archives ${{ env.APPDATA }}\vcpkg\archives - key: ${{ runner.os }}-${{ matrix.compiler }}-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('./vcpkg.json')}} + key: ${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.build_type }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('./vcpkg.json')}} restore-keys: | - ${{ runner.os }}-${{ env.BUILD_TYPE }} + ${{ runner.os }}-${{ matrix.build_type }} - name: Setup Cache uses: ./.github/actions/setup_cache with: compiler: ${{ matrix.compiler }} build_type: ${{ matrix.build_type }} - developer_mode: trrue + developer_mode: true generator: ${{ matrix.generator }} - name: Setup Cpp @@ -231,12 +231,24 @@ jobs: # flags: ${{ runner.os }} # name: ${{ runner.os }}-coverage # files: ./build/coverage.xml - + - name: Setup tests shell: bash run: | mkdir -p ./tests/bin/log mkdir -p ./bin/log + - name: Root dir + shell: bash + run: | + ls . + - name: Build dir + shell: bash + run: | + ls build + - name: Test dir + shell: bash + run: | + ls tests - name: Run tests if: contains(matrix.generator, 'Unix Makefiles') shell: bash @@ -252,7 +264,11 @@ jobs: shell: bash run: | ./build/tests/${{matrix.build_type}}/Core-Tests.exe - benchmarks: + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + doc: needs: [builds] uses: ./.github/workflows/benchmark-and-deploy.yaml with: diff --git a/.github/workflows/compilation.yaml b/.github/workflows/compilation.yaml deleted file mode 100644 index cd544528f..000000000 --- a/.github/workflows/compilation.yaml +++ /dev/null @@ -1,123 +0,0 @@ -run-name: Check builds -name: Check builds -on: - workflow_dispatch: - push: - pull_request: - types: [opened] - pull_request_target: - branches: - - "*" - -jobs: - macos-build: - strategy: - fail-fast: false - matrix: - os: [macos-11, macos-12] - inja: [ON, OFF] - name: MacOS / ${{ matrix.os }} / clang++ / Inja ${{ matrix.inja }} - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - name: Install dependencies on ${{ matrix.os }} - run: | - brew install llvm cmake - cmake --version - clang++ --version - - name: Configure with Clang - shell: bash - run: | - CC=clang CXX=clang++ cmake -DUSE_INJA=${{ matrix.inja }} -G 'Unix Makefiles' . - - name: Build - shell: bash - run: | - make - - name: Run tests - shell: bash - run: | - mkdir -p ./tests/bin/log ./bin/log - ./tests/Core-Tests - ./tests/Core-Tests | sed -E "s/`printf "\033"`\[([0-9]+)(;1)?m//g" | cat > ./bin/log/performance.txt - windows-build: - strategy: - fail-fast: false - matrix: - os: [windows-2019, windows-2022] - cxx: [cl, clang++, g++] - inja: [ON, OFF] - include: - - cxx: clang++ - cc: clang - - cxx: g++ - cc: gcc - - cxx: cl - cc: cl - name: Windows / ${{ matrix.os }} / ${{ matrix.cxx }} / Inja ${{ matrix.inja }} - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - uses: ilammy/msvc-dev-cmd@v1.4.1 - - name: Compilers setup - run: | - choco install llvm - choco install mingw --version 11.2.0.07112021 - - name: Configure with ${{ matrix.cxx }} - shell: bash - run: | - CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} cmake -DUSE_INJA=${{ matrix.inja }} -G 'MinGW Makefiles' . - - name: Build - shell: bash - run: | - make - - name: Setup - shell: bash - run: | - mkdir -p ./tests/bin/log - mkdir -p ./bin/log - ls . ./tests/ - - name: Run tests - shell: bash - run: | - ./tests/Core-Tests.exe - ubuntu-build: - strategy: - fail-fast: false - matrix: - os: [ubuntu-20.04, ubuntu-22.04] - cxx: [clang++, g++] - inja: [ON, OFF] - include: - - cxx: clang++ - cc: clang - - cxx: g++ - cc: gcc - name: Ubuntu / ${{ matrix.os }} / ${{ matrix.cxx }} / Inja ${{ matrix.inja }} - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - name: Compilers setup - run: | - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - sudo apt-get update - sudo apt-get install -y llvm g++-11 gcc-11 - - name: Configure with ${{ matrix.cxx }} - shell: bash - run: | - CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} cmake -DUSE_INJA=${{ matrix.inja }} -G 'Unix Makefiles' . - - name: Build - shell: bash - run: | - make - - name: Run tests - shell: bash - run: | - mkdir -p ./tests/bin/log ./bin/log - ./tests/Core-Tests - ./tests/Core-Tests | sed -E "s/`printf "\033"`\[([0-9]+)(;1)?m//g" | cat > ./bin/log/performance.txt \ No newline at end of file diff --git a/reports/benchmark/index.html b/reports/benchmark/index.html index 97dad563f..3e6bdb51a 100644 --- a/reports/benchmark/index.html +++ b/reports/benchmark/index.html @@ -4,100 +4,100 @@
| ac++-O | ac++-O1 | ac++-O2 | ac++-O3 | ac++-Ofast | ac++-Og | ac++-Os | c++-O | c++-O1 | c++-O2 | c++-O3 | c++-Ofast | c++-Og | c++-Os | node | python | +ac++-O |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.000670 | 0.000708 | 0.001045 | 0.000716 | 0.000669 | 0.001095 | 0.000551 | 0.000929 | 0.001143 | 0.000573 | 0.000625 | 0.001079 | 0.000591 | 0.000915 | 0.010616 | 0.002242 | +0.000847 |
| 0.001347 | 0.000790 | 0.001606 | 0.001430 | 0.001912 | 0.001005 | 0.002777 | 0.001701 | 0.000926 | 0.003493 | 0.000454 | 0.000406 | 0.000406 | 0.000806 | 0.001428 | 0.001421 | +0.000778 |
| 0.000389 | 0.000779 | 0.000660 | 0.001550 | 0.000520 | 0.001432 | 0.000645 | 0.001639 | 0.000893 | 0.000262 | 0.000820 | 0.000369 | 0.000382 | 0.000763 | 0.001542 | 0.001452 | +0.000750 |
| 0.000932 | 0.000782 | 0.000412 | 0.000539 | 0.000518 | 0.001413 | 0.000337 | 0.000712 | 0.000865 | 0.000261 | 0.001321 | 0.000379 | 0.000367 | 0.000754 | 0.001014 | 0.001751 | +0.000804 |
| 0.000471 | 0.000766 | 0.000423 | 0.000745 | 0.000507 | 0.000968 | 0.000310 | 0.002216 | 0.000888 | 0.000261 | 0.000729 | 0.000573 | 0.000360 | 0.000739 | 0.002892 | 0.001568 | +0.000738 |
| 0.000472 | 0.000757 | 0.016240 | 0.000534 | 0.000505 | 0.011495 | 0.003131 | 0.000376 | 0.000888 | 0.000262 | 0.000727 | 0.000393 | 0.001922 | 0.000732 | 0.001224 | 0.001596 | +0.000737 |
| 0.000470 | 0.000755 | 0.000429 | 0.000753 | 0.000505 | 0.000869 | 0.000530 | 0.000339 | 0.000906 | 0.000261 | 0.000745 | 0.000359 | 0.000854 | 0.000758 | 0.000971 | 0.001491 | +0.000744 |
| 0.000506 | 0.006560 | 0.000433 | 0.000307 | 0.000515 | 0.000563 | 0.000311 | 0.000316 | 0.000874 | 0.000254 | 0.000726 | 0.000585 | 0.000823 | 0.000744 | 0.001303 | 0.001546 | +0.000733 |
| 0.000430 | 0.000571 | 0.000423 | 0.000304 | 0.000571 | 0.001717 | 0.000295 | 0.000347 | 0.002288 | 0.000279 | 0.000731 | 0.000544 | 0.000334 | 0.000741 | 0.001256 | 0.001362 | +0.000741 |
| 0.000318 | 0.000529 | 0.000388 | 0.000307 | 0.000518 | 0.000496 | 0.000298 | 0.000362 | 0.001904 | 0.005000 | 0.000738 | 0.000551 | 0.000350 | 0.000743 | 0.001296 | 0.001359 | +0.002229 |
| 0.000436 | 0.000516 | 0.000411 | 0.000309 | 0.000517 | 0.000504 | 0.000293 | 0.000332 | 0.000422 | 0.000286 | 0.000718 | 0.000567 | 0.000351 | 0.000742 | 0.001069 | 0.001431 | +0.000308 |
| 0.001811 | 0.000539 | 0.000398 | 0.000421 | 0.000588 | 0.000462 | 0.000302 | 0.000320 | 0.000598 | 0.000287 | 0.000740 | 0.000560 | 0.000359 | 0.000861 | 0.000915 | 0.001619 | +0.000298 |
| 0.000786 | 0.000552 | 0.000444 | 0.000337 | 0.000580 | 0.000424 | 0.000321 | 0.000333 | 0.001279 | 0.000641 | 0.001042 | 0.000556 | 0.000341 | 0.000756 | 0.001134 | 0.001891 | +0.000301 |
| 0.000838 | 0.000594 | 0.000574 | 0.000349 | 0.000619 | 0.000550 | 0.000348 | 0.000333 | 0.000739 | 0.000301 | 0.001416 | 0.000367 | 0.000387 | 0.000766 | 0.001457 | 0.002721 | +0.000346 |
| 0.003390 | 0.000679 | 0.003592 | 0.000393 | 0.000804 | 0.000523 | 0.001106 | 0.000357 | 0.000644 | 0.000330 | 0.000927 | 0.000545 | 0.001371 | 0.000783 | 0.001741 | 0.003864 | +0.000391 |
| 0.000772 | 0.000780 | 0.000586 | 0.000561 | 0.012239 | 0.000898 | 0.001442 | 0.000387 | 0.000474 | 0.000729 | 0.000806 | 0.001849 | 0.000796 | 0.000857 | 0.002746 | 0.005562 | +0.000504 |
| 0.000987 | 0.001040 | 0.000765 | 0.000700 | 0.001325 | 0.001038 | 0.001053 | 0.000449 | 0.000656 | 0.000481 | 0.000933 | 0.001951 | 0.000545 | 0.000940 | 0.004706 | 0.010128 | +0.000707 |
| 0.004628 | 0.001592 | 0.001163 | 0.001103 | 0.001600 | 0.001719 | 0.001354 | 0.000576 | 0.001815 | 0.000676 | 0.001053 | 0.001103 | 0.000749 | 0.001130 | 0.008100 | 0.018263 | +0.001072 |
| 0.001939 | 0.002650 | 0.002092 | 0.001963 | 0.002666 | 0.003012 | 0.002484 | 0.000811 | 0.000961 | 0.000909 | 0.001520 | 0.001982 | 0.001247 | 0.001526 | 0.015503 | 0.035397 | +0.001867 |
| 0.003655 | 0.004955 | 0.003585 | 0.003542 | 0.013005 | 0.005702 | 0.004579 | 0.001314 | 0.001568 | 0.001858 | 0.002449 | 0.009914 | 0.002109 | 0.003091 | 0.029776 | 0.068095 | +0.003829 |
| 0.006719 | 0.009149 | 0.020947 | 0.006747 | 0.009226 | 0.010988 | 0.009123 | 0.003418 | 0.002705 | 0.003453 | 0.003918 | 0.014665 | 0.001752 | 0.005497 | 0.058060 | 0.135044 | +0.006677 |
| 0.013068 | 0.017618 | 0.015632 | 0.013076 | 0.018397 | 0.021663 | 0.017412 | 0.005057 | 0.005865 | 0.006659 | 0.007226 | 0.004318 | 0.007056 | 0.007330 | 0.114869 | 0.268044 | +0.013007 |
| 0.025882 | 0.034550 | 0.031476 | 0.025748 | 0.036705 | 0.042852 | 0.034352 | 0.008057 | 0.009964 | 0.013122 | 0.013228 | 0.008241 | 0.013219 | 0.015927 | 0.229910 | 0.531083 | +0.025676 |
| 0.051284 | 0.069709 | 0.096490 | 0.051140 | 0.067903 | 0.084976 | 0.068373 | 0.015887 | 0.020277 | 0.025768 | 0.025600 | 0.016002 | 0.025918 | 0.026063 | 0.457299 | 1.061427 | +0.051039 |
| 0.101934 | 0.135635 | 0.142184 | 0.101961 | 0.135682 | 0.171249 | 0.148763 | 0.031392 | 0.037585 | 0.051166 | 0.051679 | 0.031508 | 0.029293 | 0.051029 | 0.910041 | 2.123144 | +0.101757 |
| 0.203226 | 0.270985 | 0.277744 | 0.209084 | 0.271539 | 0.340839 | 0.275269 | 0.062207 | 0.074491 | 0.101369 | 0.104122 | 0.062407 | 0.057665 | 0.101680 | 1.815620 | 4.245404 | +0.204022 |
| 0.405827 | 0.554926 | 0.497794 | 0.405619 | 0.541189 | 0.678679 | 0.543675 | 0.138108 | 0.149189 | 0.225842 | 0.205320 | 0.124074 | 0.150511 | 0.203211 | 3.641856 | 8.483024 | +0.412898 |
| 0.811532 | 1.171075 | 1.449017 | 0.830773 | 1.086252 | 1.466859 | 1.085286 | 0.247627 | 0.304694 | 0.408509 | 0.403195 | 0.251489 | 0.259781 | 0.407739 | 7.243299 | 16.967113 | +0.812177 |
| 1.683381 | 2.177057 | 2.615836 | 1.717206 | 2.173278 | 2.707818 | 2.226197 | 0.495966 | 0.596622 | 0.819342 | 0.806690 | 0.495388 | 0.672000 | 0.814058 | 14.470173 | 33.923630 | +1.624650 |
| 3.397197 | 4.431571 | 6.258133 | 3.277568 | 4.369839 | 5.544881 | 4.437700 | 1.100112 | 1.186373 | 1.608033 | 1.621170 | 0.988942 | 1.131706 | 1.630917 | 28.954102 | 67.898388 | +3.308881 |
| 6.607683 | 8.742111 | 9.011113 | 6.577873 | 8.640603 | 11.072173 | 8.711616 | 1.980622 | 2.478380 | 3.217474 | 3.209168 | 2.005704 | 2.372409 | 3.260668 | 57.316040 | 134.113890 | +6.550800 |