diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff01f0ed..cdb93582 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: install: base-devel mingw-w64-${{matrix.env}}-toolchain - run: make - run: make test - code-coverage: + code-coverage-old: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -50,6 +50,38 @@ jobs: uses: hrishikesh-kadam/setup-lcov@v1 - name: Build and Run tests run: make coverage -j + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@v5 + # with: + # files: ./cov-html/libopenlibm.info + # token: ${{ secrets.CODECOV_TOKEN }} + - uses: actions/upload-artifact@v4 + with: + name: code-coverage-report-old + path: ./cov-html/ + code-coverage: + runs-on: ubuntu-latest + steps: + - name: Checkout Openlibm + uses: actions/checkout@v4 + - name: Checkout Openlibm-test + uses: actions/checkout@v4 + with: + repository: 'JuliaMath/openlibm-test' + path: 'openlibm-test' + - name: Setup LCOV + uses: hrishikesh-kadam/setup-lcov@v1 + - name: Build Openlibm + run: make -j`nproc` CODE_COVERAGE=1 + - name: Run Test + run: | + make -j`nproc` -C openlibm-test \ + USE_OPENLIBM=1 OPENLIBM_HOME="$(pwd)" \ + SKIP_FP_EXCEPT_TEST=1 \ + - name: Show Test Result + run: cat openlibm-test/src/REPORT + - name: Gen Coverage Report + run: make gen-cov-report - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: diff --git a/.gitignore b/.gitignore index 8e1c6cbb..9f5c0be6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.pc # code coverage +openlibm-test cov-html/ *.gcda *.gcno diff --git a/Makefile b/Makefile index 17e03a07..0d7d9185 100644 --- a/Makefile +++ b/Makefile @@ -84,8 +84,11 @@ COVERAGE_DIR:=cov-html COVERAGE_FILE:=$(COVERAGE_DIR)/libopenlibm.info # Gen cov report with: make clean && make coverage -j coverage: clean-coverage - mkdir $(COVERAGE_DIR) $(MAKE) test CODE_COVERAGE=1 + $(MAKE) gen-cov-report + +gen-cov-report: + -mkdir $(COVERAGE_DIR) lcov -d amd64 -d bsdsrc -d ld80 -d src \ --rc lcov_branch_coverage=1 --capture --output-file $(COVERAGE_FILE) genhtml --legend --branch-coverage \