From 09e01e092dea26b1c22cf66ac5f728a7ad6ef390 Mon Sep 17 00:00:00 2001 From: Chengyu HAN Date: Wed, 21 May 2025 17:44:59 +0800 Subject: [PATCH 1/5] make: add new target `gen-cov-report` --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 \ From fc02a657b6c93c2eb9b99840198e924efeb08e30 Mon Sep 17 00:00:00 2001 From: Chengyu HAN Date: Wed, 21 May 2025 17:45:37 +0800 Subject: [PATCH 2/5] ci: test with openlibm-test --- .github/workflows/ci.yml | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff01f0ed..22190105 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,12 +50,43 @@ 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-test + uses: actions/checkout@v4 + with: + repository: 'inkydragon/openlibm-test' + - name: Checkout Openlibm + uses: actions/checkout@v4 + with: + repository: 'JuliaMath/openlibm' + path: 'libm/openlibm' + - name: Setup LCOV + uses: hrishikesh-kadam/setup-lcov@v1 + - name: Build Openlibm + run: make -C libm/openlibm -j`nproc` CODE_COVERAGE=1 + - name: Run Test + run: make -j`nproc` USE_OPENLIBM=1 SKIP_FP_EXCEPT_TEST=1 + - name: Show Test Result + run: cat src/REPORT + - name: GEn Coverage Report + run: make -C libm/openlibm gen-cov-report - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: - files: ./cov-html/libopenlibm.info + files: ./libm/openlibm/cov-html/libopenlibm.info token: ${{ secrets.CODECOV_TOKEN }} - uses: actions/upload-artifact@v4 with: name: code-coverage-report - path: ./cov-html/ + path: ./libm/openlibm/cov-html/ From 3eff06b79699b7da2107c7281b225def183e84fc Mon Sep 17 00:00:00 2001 From: Chengyu HAN Date: Wed, 21 May 2025 17:59:51 +0800 Subject: [PATCH 3/5] ci: checkout openlibm first --- .github/workflows/ci.yml | 22 ++++++++++------------ .gitignore | 1 + 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22190105..8553b236 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,31 +62,29 @@ jobs: code-coverage: runs-on: ubuntu-latest steps: + - name: Checkout Openlibm + uses: actions/checkout@v4 - name: Checkout Openlibm-test uses: actions/checkout@v4 with: repository: 'inkydragon/openlibm-test' - - name: Checkout Openlibm - uses: actions/checkout@v4 - with: - repository: 'JuliaMath/openlibm' - path: 'libm/openlibm' + path: 'openlibm-test' - name: Setup LCOV uses: hrishikesh-kadam/setup-lcov@v1 - name: Build Openlibm - run: make -C libm/openlibm -j`nproc` CODE_COVERAGE=1 + run: make -j`nproc` CODE_COVERAGE=1 - name: Run Test - run: make -j`nproc` USE_OPENLIBM=1 SKIP_FP_EXCEPT_TEST=1 + run: make -j`nproc` -C openlibm-test USE_OPENLIBM=1 SKIP_FP_EXCEPT_TEST=1 - name: Show Test Result - run: cat src/REPORT - - name: GEn Coverage Report - run: make -C libm/openlibm gen-cov-report + 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: - files: ./libm/openlibm/cov-html/libopenlibm.info + files: ./cov-html/libopenlibm.info token: ${{ secrets.CODECOV_TOKEN }} - uses: actions/upload-artifact@v4 with: name: code-coverage-report - path: ./libm/openlibm/cov-html/ + path: ./cov-html/ 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 From 92a224da2daf68fefbffbe27fbca2fdd2748d893 Mon Sep 17 00:00:00 2001 From: Chengyu HAN Date: Wed, 21 May 2025 18:04:26 +0800 Subject: [PATCH 4/5] ci: set OPENLIBM_HOME --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8553b236..5985637a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,7 +74,10 @@ jobs: - name: Build Openlibm run: make -j`nproc` CODE_COVERAGE=1 - name: Run Test - run: make -j`nproc` -C openlibm-test USE_OPENLIBM=1 SKIP_FP_EXCEPT_TEST=1 + 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 From 874d387c0458debe8293ebb024c1147853b42c91 Mon Sep 17 00:00:00 2001 From: Chengyu HAN Date: Wed, 21 May 2025 22:01:28 +0800 Subject: [PATCH 5/5] ci: update repo name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5985637a..cdb93582 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: - name: Checkout Openlibm-test uses: actions/checkout@v4 with: - repository: 'inkydragon/openlibm-test' + repository: 'JuliaMath/openlibm-test' path: 'openlibm-test' - name: Setup LCOV uses: hrishikesh-kadam/setup-lcov@v1