name: CoverageReport on: [push, pull_request] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: strategy: fail-fast: false matrix: config: - os: "ubuntu-latest" cxx-compiler: g++ c-compiler: gcc compiler-version: 12 build-type: RelWithDebInfo runs-on: ${{ matrix.config.os }} steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v6 - name: Cache curl uses: actions/cache@v5 with: path: lib/curl-8_14_1 key: ${{ matrix.config.os }}-${{ matrix.config.cxx-compiler }}-${{ matrix.config.compiler-version }}-curl-8.14.1-2 - name: Cache antlr uses: actions/cache@v5 with: path: lib/antlr-cb85012 key: ${{ matrix.config.os }}-${{ matrix.config.cxx-compiler }}-${{ matrix.config.compiler-version }}-antlr-cb85012-2 - name: Cache boost uses: actions/cache@v5 with: path: lib/boost_1_91_0-1 key: ${{ matrix.config.os }}-${{ matrix.config.cxx-compiler }}-${{ matrix.config.compiler-version }}-boost-1.91.0-1 - name: Cache cppdap uses: actions/cache@v5 with: path: lib/cppdap-82beeea key: ${{ matrix.config.os }}-${{ matrix.config.cxx-compiler }}-${{ matrix.config.compiler-version }}-cppdap-82beeea-2 - name: Install Compiler and Dependencies shell: pwsh run: | sudo apt-get update $compiler = "${{ matrix.config.cxx-compiler }}" $version = "${{ matrix.config.compiler-version }}" if ($version -ne 'default') { sudo apt-get install "$compiler-$version" -y } sudo apt-get install kwstyle -y sudo apt-get install uuid-dev -y sudo apt-get install lcov -y pip install aiosmtpd $ninja_version = "1.12.1" $cmake_version = "3.31.3" $cmake_archive = "cmake-$cmake_version-linux-x86_64" wget -q "https://github.com/ninja-build/ninja/releases/download/v$ninja_version/ninja-linux.zip" unzip -q ninja-linux.zip -d bin-build wget -q "https://github.com/Kitware/CMake/releases/download/v$cmake_version/$cmake_archive.tar.gz" tar -xf "$cmake_archive.tar.gz" chmod +x bin-build/ninja chmod +x "$cmake_archive/bin/cmake" pip install fastcov echo "$Env:GITHUB_WORKSPACE/bin-build" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo "$Env:GITHUB_WORKSPACE/$cmake_archive/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Set CXX and CC shell: pwsh run: | $cxx_compiler = '${{ matrix.config.cxx-compiler }}' $c_compiler = '${{ matrix.config.c-compiler }}' $version = '${{ matrix.config.compiler-version }}' if ($version -ne 'default') { $cxx_compiler = "$cxx_compiler-$version" $c_compiler = "$c_compiler-$version" } echo "CXX=$cxx_compiler" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "CC=$c_compiler" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Config run: | cd bin-build cmake .. -G Ninja -DGCOV=1 -DREUSE_PCH=1 -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} - name: Build run: | cd bin-build cmake --build . --config ${{ matrix.config.build-type }} -- -j 4 - name: Start MySQL shell: pwsh run: | sudo /etc/init.d/mysql start mysql -e "CREATE DATABASE IF NOT EXISTS poltest;" -uroot -proot echo "POLCORE_TESTSQL=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Test (EScript) run: | cd bin-build cmake --build . --config ${{ matrix.config.build-type }} --target test_escript - name: Test (Shard Fixtures) run: | cd bin-build cmake --build . --config ${{ matrix.config.build-type }} --target test_pol_fixture - name: Test (UnitTests) run: | cd bin-build cmake --build . --config ${{ matrix.config.build-type }} --target unittest_pol - name: Test (Shard) run: | cd bin-build cmake --build . --config ${{ matrix.config.build-type }} --target test_pol_only - name: Testsummary if: always() shell: bash run: | cd bin-build { python coretest/ci_summary.py Testing/Temporary/LastTest.log } > "$GITHUB_STEP_SUMMARY" - name: Test (Ecompile Watch) run: | cd bin-build cmake --build . --config ${{ matrix.config.build-type }} --target test_ecompile_watch - name: Coverage run: | cd bin-build fastcov -g gcov-${{ matrix.config.compiler-version }} -t PolCore --lcov -i pol-core -o pol-core.info genhtml --demangle-cpp -o coverage pol-core.info cmake -E tar c coverage.zip --format=zip coverage - name: Upload shard test log uses: actions/upload-artifact@v7 with: name: Testlog-${{ runner.os }}-${{ matrix.config.cxx-compiler }} path: bin-build/coretest/log/pol.log - name: Upload coverage report uses: actions/upload-artifact@v7 with: name: Coveragelog path: bin-build/coverage.zip - name: Coveralls uses: coverallsapp/github-action@master with: path-to-lcov: bin-build/pol-core.info github-token: ${{ secrets.GITHUB_TOKEN }} notify_on_failure: needs: build runs-on: "ubuntu-latest" if: failure() steps: - name: Discord notification failure env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} uses: turleypol/actions-status-discord@master with: status: failure job: Coverage Report notify_on_success: needs: build runs-on: "ubuntu-latest" if: success() steps: - name: Discord notification success env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} uses: turleypol/actions-status-discord@master with: status: success job: Coverage Report notify_on_cancel: needs: build runs-on: "ubuntu-latest" if: cancelled() steps: - name: Discord notification cancelled env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} uses: turleypol/actions-status-discord@master with: status: cancelled job: Coverage Report