add infra to support multiple v8 versions #204
Workflow file for this run
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: Coverage | |
on: | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'docs/**' | |
jobs: | |
coverage-ubuntu-gcc: | |
timeout-minutes: 30 | |
# JavaScriptCore requires libicu66 which is only avaliable on ubuntu-20.04 | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
backends: [ V8, JavaScriptCore, QuickJs, Lua ] | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/[email protected] | |
with: | |
key: ScriptX-UnitTests-Depedencies-${{ hashFiles('test/cmake/**') }} | |
path: | | |
build/ScriptXTestLibs | |
build/googletest-src | |
- name: prepare lcov | |
run: | | |
sudo apt-get install -y lcov | |
- name: Configure cmake | |
env: | |
SCRIPTX_TEST_FORCE_UPDATE_DEPS: ON | |
run: | | |
mkdir -p build && cd build | |
cmake ../test \ | |
-DSCRIPTX_BACKEND=${{ matrix.backends }} \ | |
-DDEVOPS_ENABLE_COVERAGE=ON \ | |
-DCMAKE_BUILD_TYPE=DEBUG | |
- name: Compile UnitTests | |
run: | | |
cd build | |
cmake --build . -j $(nproc) --target UnitTests | |
- name: Run UnitTests | |
run: | | |
cd build && ./UnitTests | |
- name: Generate Coverate Data | |
# https://clang.llvm.org/docs/SourceBasedCodeCoverage.html | |
run: | | |
cd build | |
lcov -c -d CMakeFiles/ -o all.info | |
lcov -e all.info -o coverage.info '*/ScriptX/src/*' '*/ScriptX/backend/*' | |
- name: Coveralls GitHub Action | |
uses: coverallsapp/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: './build/coverage.info' | |
flag-name: "Backend-${{ matrix.backends }}" | |
parallel: true | |
coverage-finish: | |
timeout-minutes: 30 | |
needs: coverage-ubuntu-gcc | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/[email protected] | |
with: | |
github-token: ${{ secrets.github_token }} | |
parallel-finished: true |