From 4f6621518a370e9f6c3c71e0ae8cf1c6706fc244 Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Tue, 21 Oct 2025 20:02:37 +0530 Subject: [PATCH 01/17] uplaod r and js coverage together after both are computed --- .github/workflows/tests.yaml | 132 +++++++++++++++++++++++++++-------- 1 file changed, 103 insertions(+), 29 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f5ca6bb34..08dd3a82f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -6,17 +6,47 @@ on: branches: [main, master] jobs: - R-CMD-check: + r-tests: runs-on: ubuntu-latest + name: R coverage tests + env: + TEST_SUITE: R_coverage + GITHUB_PAT: ${{ secrets.PAT_GITHUB }} + GH_ACTION: "ENABLED" + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + steps: + - uses: actions/checkout@v3 + - name: install and update texlive + run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq + - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt install tidy texlive texlive-fonts-extra -y + - uses: r-lib/actions/setup-r@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 - strategy: - fail-fast: false - matrix: - test-suite: [ R_coverage, JS_coverage, CRAN ] + - name: install package + run: R CMD INSTALL . + + - name: git config user.name + run: git config --global user.name "GitHub Actions" - name: ${{ matrix.test-suite }} - env: - TEST_SUITE: ${{ matrix.test-suite }} + - name: git config user.email + run: git config --global user.email toby.hocking@r-project.org + + - name: Run R tests and write lcov + run: | + echo "Generating R test coverage lcov file" + Rscript -e "library(covr); cov <- covr::package_coverage(path='.', type='tests'); covr::to_lcov(cov, file='r-coverage.lcov')" + + - name: Upload R coverage artifact + uses: actions/upload-artifact@v3 + with: + name: r-coverage + path: r-coverage.lcov + + js-tests: + runs-on: ubuntu-latest + name: JS coverage tests + env: + TEST_SUITE: JS_coverage GITHUB_PAT: ${{ secrets.PAT_GITHUB }} GH_ACTION: "ENABLED" CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} @@ -38,48 +68,92 @@ jobs: run: git config --global user.email toby.hocking@r-project.org - name: Setup Node.js - if: matrix.test-suite == 'JS_coverage' uses: actions/setup-node@v3 with: node-version: '18' - - name: Install Node.js dependencies - if: matrix.test-suite == 'JS_coverage' run: | npm install v8-to-istanbul echo "Node modules installed" - - - name: run tests + - name: Run JS tests (R + JS coverage collection) run: | - if [ "$TEST_SUITE" == "CRAN" ]; then - bash build.sh - elif [ "$TEST_SUITE" == "JS_coverage" ]; then - echo "Running testthat with JS coverage collection..." - Rscript -e "source('tests/testthat.R', chdir = TRUE)" - else - echo "Running testthat with R coverage collection..." - Rscript -e 'covr::codecov(quiet = FALSE, type = "tests", test_files = "tests/testthat.R", flags = "r")' - fi + echo "Running testthat with JS coverage collection..." + Rscript -e "source('tests/testthat.R', chdir = TRUE)" - name: Convert JS coverage to Istanbul format - if: matrix.test-suite == 'JS_coverage' run: | if [ -f "tests/testthat/js-coverage.json" ]; then - echo "Converting JS coverage to LCOV format..." + echo "Converting JS coverage to Istanbul format..." node v8-to-istanbul.js else echo "No JS coverage file found" exit 1 fi - - name: Upload JS coverage to Codecov - if: matrix.test-suite == 'JS_coverage' + - name: Upload JS coverage artifact + uses: actions/upload-artifact@v3 + with: + name: js-coverage + path: coverage-istanbul.json + + CRAN: + runs-on: ubuntu-latest + name: CRAN checks + env: + TEST_SUITE: CRAN + GITHUB_PAT: ${{ secrets.PAT_GITHUB }} + GH_ACTION: "ENABLED" + steps: + - uses: actions/checkout@v3 + - name: install and update texlive + run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq + - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt install tidy texlive texlive-fonts-extra -y + - uses: r-lib/actions/setup-r@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 + + - name: install package + run: R CMD INSTALL . + + - name: git config user.name + run: git config --global user.name "GitHub Actions" + + - name: git config user.email + run: git config --global user.email toby.hocking@r-project.org + + - name: run CRAN build + run: bash build.sh + + upload-coverage: + runs-on: ubuntu-latest + name: Upload combined coverage to Codecov + needs: [r-tests, js-tests] + if: always() + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + steps: + - name: Download R coverage artifact + uses: actions/download-artifact@v3 + with: + name: r-coverage + path: ./artifacts + + - name: Download JS coverage artifact + uses: actions/download-artifact@v3 + with: + name: js-coverage + path: ./artifacts + + - name: Show downloaded files + run: ls -la artifacts || true + + - name: Upload to Codecov run: | - if [ -f "coverage-istanbul.json" ]; then + if [ -f "artifacts/r-coverage.lcov" ] && [ -f "artifacts/coverage-istanbul.json" ]; then + echo "Uploading both R and JS coverage to Codecov" curl -Os https://uploader.codecov.io/latest/linux/codecov chmod +x codecov - ./codecov -f coverage-istanbul.json -t ${{ secrets.CODECOV_TOKEN }} --flags javascript + ./codecov -f artifacts/r-coverage.lcov -f artifacts/coverage-istanbul.json -t $CODECOV_TOKEN --flags "r,javascript" else - echo "No coverage file found" + echo "Missing one or both coverage files. Abort upload." >&2 exit 1 fi From d5b7a2e37a5840d809d18027200f41967a1094e7 Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Tue, 21 Oct 2025 20:08:48 +0530 Subject: [PATCH 02/17] updated version of actions/upload-artifact --- .github/workflows/tests.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 08dd3a82f..ebea4ce0e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -37,7 +37,7 @@ jobs: Rscript -e "library(covr); cov <- covr::package_coverage(path='.', type='tests'); covr::to_lcov(cov, file='r-coverage.lcov')" - name: Upload R coverage artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: r-coverage path: r-coverage.lcov @@ -91,7 +91,7 @@ jobs: fi - name: Upload JS coverage artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: js-coverage path: coverage-istanbul.json @@ -132,13 +132,13 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - name: Download R coverage artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: r-coverage path: ./artifacts - name: Download JS coverage artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: js-coverage path: ./artifacts From a2f1ce18ae6fd7d9743c1b01c6c1a682f9c5a91d Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Tue, 21 Oct 2025 22:17:55 +0530 Subject: [PATCH 03/17] added setup for cleaner code --- .github/workflows/tests.yaml | 95 +++++++++++++----------------------- 1 file changed, 35 insertions(+), 60 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ebea4ce0e..605a1493f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -6,7 +6,33 @@ on: branches: [main, master] jobs: + setup: + runs-on: ubuntu-latest + outputs: + R_SETUP_PATH: ${{ steps.r-setup.outputs.r-path }} + steps: + - uses: actions/checkout@v3 + + - name: Install system dependencies + run: | + sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq + sudo DEBIAN_FRONTEND=noninteractive apt install -y tidy texlive texlive-fonts-extra + + - uses: r-lib/actions/setup-r@v2 + id: r-setup + + - uses: r-lib/actions/setup-r-dependencies@v2 + + - name: Configure git + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "toby.hocking@r-project.org" + + - name: Install package + run: R CMD INSTALL . + r-tests: + needs: setup runs-on: ubuntu-latest name: R coverage tests env: @@ -16,26 +42,10 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - uses: actions/checkout@v3 - - name: install and update texlive - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq - - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt install tidy texlive texlive-fonts-extra -y - - uses: r-lib/actions/setup-r@v2 - - uses: r-lib/actions/setup-r-dependencies@v2 - - - name: install package - run: R CMD INSTALL . - - - name: git config user.name - run: git config --global user.name "GitHub Actions" - - - name: git config user.email - run: git config --global user.email toby.hocking@r-project.org - - name: Run R tests and write lcov run: | echo "Generating R test coverage lcov file" - Rscript -e "library(covr); cov <- covr::package_coverage(path='.', type='tests'); covr::to_lcov(cov, file='r-coverage.lcov')" - + Rscript -e "if (!requireNamespace('covr', quietly=TRUE)) install.packages('covr'); library(covr); cov <- covr::package_coverage(path='.', type='tests'); covr:::to_lcov(cov, file='r-coverage.lcov')" - name: Upload R coverage artifact uses: actions/upload-artifact@v4 with: @@ -43,6 +53,7 @@ jobs: path: r-coverage.lcov js-tests: + needs: setup runs-on: ubuntu-latest name: JS coverage tests env: @@ -52,44 +63,22 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - uses: actions/checkout@v3 - - name: install and update texlive - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq - - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt install tidy texlive texlive-fonts-extra -y - - uses: r-lib/actions/setup-r@v2 - - uses: r-lib/actions/setup-r-dependencies@v2 - - - name: install package - run: R CMD INSTALL . - - - name: git config user.name - run: git config --global user.name "GitHub Actions" - - - name: git config user.email - run: git config --global user.email toby.hocking@r-project.org - - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: '18' - name: Install Node.js dependencies - run: | - npm install v8-to-istanbul - echo "Node modules installed" - - name: Run JS tests (R + JS coverage collection) - run: | - echo "Running testthat with JS coverage collection..." - Rscript -e "source('tests/testthat.R', chdir = TRUE)" - + run: npm install v8-to-istanbul + - name: Run JS tests (R + JS coverage) + run: Rscript -e "source('tests/testthat.R', chdir = TRUE)" - name: Convert JS coverage to Istanbul format run: | if [ -f "tests/testthat/js-coverage.json" ]; then - echo "Converting JS coverage to Istanbul format..." node v8-to-istanbul.js else - echo "No JS coverage file found" + echo "No JS coverage file found" >&2 exit 1 fi - - name: Upload JS coverage artifact uses: actions/upload-artifact@v4 with: @@ -97,6 +86,7 @@ jobs: path: coverage-istanbul.json CRAN: + needs: setup runs-on: ubuntu-latest name: CRAN checks env: @@ -105,28 +95,13 @@ jobs: GH_ACTION: "ENABLED" steps: - uses: actions/checkout@v3 - - name: install and update texlive - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq - - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt install tidy texlive texlive-fonts-extra -y - - uses: r-lib/actions/setup-r@v2 - - uses: r-lib/actions/setup-r-dependencies@v2 - - - name: install package - run: R CMD INSTALL . - - - name: git config user.name - run: git config --global user.name "GitHub Actions" - - - name: git config user.email - run: git config --global user.email toby.hocking@r-project.org - - - name: run CRAN build + - name: Run CRAN build run: bash build.sh upload-coverage: + needs: [r-tests, js-tests] runs-on: ubuntu-latest name: Upload combined coverage to Codecov - needs: [r-tests, js-tests] if: always() env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 38acf607771d0958b1d7e00128874ccaf4c2b08c Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Tue, 21 Oct 2025 22:33:39 +0530 Subject: [PATCH 04/17] no setup --- .github/workflows/tests.yaml | 92 +++++++++++++++++++++++------------- 1 file changed, 58 insertions(+), 34 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 605a1493f..8b17496b7 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -6,33 +6,7 @@ on: branches: [main, master] jobs: - setup: - runs-on: ubuntu-latest - outputs: - R_SETUP_PATH: ${{ steps.r-setup.outputs.r-path }} - steps: - - uses: actions/checkout@v3 - - - name: Install system dependencies - run: | - sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq - sudo DEBIAN_FRONTEND=noninteractive apt install -y tidy texlive texlive-fonts-extra - - - uses: r-lib/actions/setup-r@v2 - id: r-setup - - - uses: r-lib/actions/setup-r-dependencies@v2 - - - name: Configure git - run: | - git config --global user.name "GitHub Actions" - git config --global user.email "toby.hocking@r-project.org" - - - name: Install package - run: R CMD INSTALL . - r-tests: - needs: setup runs-on: ubuntu-latest name: R coverage tests env: @@ -42,6 +16,21 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - uses: actions/checkout@v3 + - name: install and update texlive + run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq + - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt install tidy texlive texlive-fonts-extra -y + - uses: r-lib/actions/setup-r@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 + + - name: install package + run: R CMD INSTALL . + + - name: git config user.name + run: git config --global user.name "GitHub Actions" + + - name: git config user.email + run: git config --global user.email toby.hocking@r-project.org + - name: Run R tests and write lcov run: | echo "Generating R test coverage lcov file" @@ -53,7 +42,6 @@ jobs: path: r-coverage.lcov js-tests: - needs: setup runs-on: ubuntu-latest name: JS coverage tests env: @@ -63,22 +51,44 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - uses: actions/checkout@v3 + - name: install and update texlive + run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq + - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt install tidy texlive texlive-fonts-extra -y + - uses: r-lib/actions/setup-r@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 + + - name: install package + run: R CMD INSTALL . + + - name: git config user.name + run: git config --global user.name "GitHub Actions" + + - name: git config user.email + run: git config --global user.email toby.hocking@r-project.org + - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: '18' - name: Install Node.js dependencies - run: npm install v8-to-istanbul - - name: Run JS tests (R + JS coverage) - run: Rscript -e "source('tests/testthat.R', chdir = TRUE)" + run: | + npm install v8-to-istanbul + echo "Node modules installed" + - name: Run JS tests (R + JS coverage collection) + run: | + echo "Running testthat with JS coverage collection..." + Rscript -e "source('tests/testthat.R', chdir = TRUE)" + - name: Convert JS coverage to Istanbul format run: | if [ -f "tests/testthat/js-coverage.json" ]; then + echo "Converting JS coverage to Istanbul format..." node v8-to-istanbul.js else - echo "No JS coverage file found" >&2 + echo "No JS coverage file found" exit 1 fi + - name: Upload JS coverage artifact uses: actions/upload-artifact@v4 with: @@ -86,7 +96,6 @@ jobs: path: coverage-istanbul.json CRAN: - needs: setup runs-on: ubuntu-latest name: CRAN checks env: @@ -95,13 +104,28 @@ jobs: GH_ACTION: "ENABLED" steps: - uses: actions/checkout@v3 - - name: Run CRAN build + - name: install and update texlive + run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq + - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt install tidy texlive texlive-fonts-extra -y + - uses: r-lib/actions/setup-r@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 + + - name: install package + run: R CMD INSTALL . + + - name: git config user.name + run: git config --global user.name "GitHub Actions" + + - name: git config user.email + run: git config --global user.email toby.hocking@r-project.org + + - name: run CRAN build run: bash build.sh upload-coverage: - needs: [r-tests, js-tests] runs-on: ubuntu-latest name: Upload combined coverage to Codecov + needs: [r-tests, js-tests] if: always() env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 1bdfce02d64d244e7220dd00064794244c937ce4 Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Wed, 22 Oct 2025 20:38:36 +0530 Subject: [PATCH 05/17] replaced to_lcov --- .github/workflows/tests.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8b17496b7..8fddc3ba9 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -34,12 +34,12 @@ jobs: - name: Run R tests and write lcov run: | echo "Generating R test coverage lcov file" - Rscript -e "if (!requireNamespace('covr', quietly=TRUE)) install.packages('covr'); library(covr); cov <- covr::package_coverage(path='.', type='tests'); covr:::to_lcov(cov, file='r-coverage.lcov')" + Rscript -e "if (!requireNamespace('covr', quietly=TRUE)) install.packages('covr'); library(covr); cov <- covr::package_coverage(path='.', type='tests'); covr::to_cobertura(cov, file='r-coverage.xml')" - name: Upload R coverage artifact uses: actions/upload-artifact@v4 with: name: r-coverage - path: r-coverage.lcov + path: r-coverage.xml js-tests: runs-on: ubuntu-latest @@ -147,11 +147,11 @@ jobs: - name: Upload to Codecov run: | - if [ -f "artifacts/r-coverage.lcov" ] && [ -f "artifacts/coverage-istanbul.json" ]; then + if [ -f "artifacts/r-coverage.xml" ] && [ -f "artifacts/coverage-istanbul.json" ]; then echo "Uploading both R and JS coverage to Codecov" curl -Os https://uploader.codecov.io/latest/linux/codecov chmod +x codecov - ./codecov -f artifacts/r-coverage.lcov -f artifacts/coverage-istanbul.json -t $CODECOV_TOKEN --flags "r,javascript" + ./codecov -f artifacts/r-coverage.xml -f artifacts/coverage-istanbul.json -t $CODECOV_TOKEN --flags "r,javascript" else echo "Missing one or both coverage files. Abort upload." >&2 exit 1 From d44e6e0129d730deed8044d896c29e409e73dad5 Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Fri, 24 Oct 2025 12:13:14 +0530 Subject: [PATCH 06/17] seperate flags --- .github/workflows/tests.yaml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8fddc3ba9..056d29d3a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -145,14 +145,18 @@ jobs: - name: Show downloaded files run: ls -la artifacts || true - - name: Upload to Codecov + - name: Upload R coverage to Codecov run: | - if [ -f "artifacts/r-coverage.xml" ] && [ -f "artifacts/coverage-istanbul.json" ]; then - echo "Uploading both R and JS coverage to Codecov" + if [ -f "artifacts/r-coverage.xml" ]; then + echo "Uploading R coverage..." curl -Os https://uploader.codecov.io/latest/linux/codecov chmod +x codecov - ./codecov -f artifacts/r-coverage.xml -f artifacts/coverage-istanbul.json -t $CODECOV_TOKEN --flags "r,javascript" - else - echo "Missing one or both coverage files. Abort upload." >&2 - exit 1 + ./codecov -f artifacts/r-coverage.xml -t $CODECOV_TOKEN --flag "r" + fi + + - name: Upload JS coverage to Codecov + run: | + if [ -f "artifacts/coverage-istanbul.json" ]; then + echo "Uploading JS coverage..." + ./codecov -f artifacts/coverage-istanbul.json -t $CODECOV_TOKEN --flag "javascript" fi From ecc349ee0e3d026397540f5a268f3b256a0cbdfb Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Fri, 24 Oct 2025 15:50:59 +0530 Subject: [PATCH 07/17] normalisation of paths --- .github/workflows/tests.yaml | 45 ++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 056d29d3a..56a97c1e7 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -35,6 +35,16 @@ jobs: run: | echo "Generating R test coverage lcov file" Rscript -e "if (!requireNamespace('covr', quietly=TRUE)) install.packages('covr'); library(covr); cov <- covr::package_coverage(path='.', type='tests'); covr::to_cobertura(cov, file='r-coverage.xml')" + + - name: Normalize R coverage paths + run: | + echo "Normalizing paths in r-coverage.xml" + if [ -f "r-coverage.xml" ]; then + sed -i "s|${GITHUB_WORKSPACE}/||g" r-coverage.xml || true + echo "First 20 lines of r-coverage.xml:" && head -n 20 r-coverage.xml || true + else + echo "r-coverage.xml not found" >&2 + fi - name: Upload R coverage artifact uses: actions/upload-artifact@v4 with: @@ -89,6 +99,15 @@ jobs: exit 1 fi + - name: Normalize JS coverage paths + run: | + echo "Normalizing JS coverage paths in coverage-istanbul.json" + if [ -f "coverage-istanbul.json" ]; then + node -e "const fs=require('fs'); const gw=process.env.GITHUB_WORKSPACE||process.cwd(); const p='coverage-istanbul.json'; const cov=JSON.parse(fs.readFileSync(p)); const out={}; Object.keys(cov).forEach(k=>{ let nk=k; if(nk.startsWith(gw+'/')) nk=nk.slice(gw.length+1); else if(nk.startsWith('file://')){ nk=nk.replace('file://',''); if(nk.startsWith(gw+'/')) nk=nk.slice(gw.length+1);} out[nk]=cov[k]; }); fs.writeFileSync(p, JSON.stringify(out)); console.log('normalized', Object.keys(out).slice(0,3));" + else + echo "coverage-istanbul.json not found" >&2 + fi + - name: Upload JS coverage artifact uses: actions/upload-artifact@v4 with: @@ -145,18 +164,24 @@ jobs: - name: Show downloaded files run: ls -la artifacts || true - - name: Upload R coverage to Codecov + - name: Upload combined coverage to Codecov run: | + echo "Preparing to upload combined coverage" + R_COV="" if [ -f "artifacts/r-coverage.xml" ]; then - echo "Uploading R coverage..." - curl -Os https://uploader.codecov.io/latest/linux/codecov - chmod +x codecov - ./codecov -f artifacts/r-coverage.xml -t $CODECOV_TOKEN --flag "r" + R_COV=artifacts/r-coverage.xml + elif [ -f "artifacts/r-coverage.lcov" ]; then + R_COV=artifacts/r-coverage.lcov fi + JS_COV=artifacts/coverage-istanbul.json - - name: Upload JS coverage to Codecov - run: | - if [ -f "artifacts/coverage-istanbul.json" ]; then - echo "Uploading JS coverage..." - ./codecov -f artifacts/coverage-istanbul.json -t $CODECOV_TOKEN --flag "javascript" + if [ -z "$R_COV" ] || [ ! -f "$JS_COV" ]; then + echo "Missing one or both coverage files: R=$R_COV JS=$JS_COV" >&2 + ls -la artifacts || true + exit 1 fi + + echo "Uploading both files: $R_COV and $JS_COV" + curl -Os https://uploader.codecov.io/latest/linux/codecov + chmod +x codecov + ./codecov -f "$R_COV" -f "$JS_COV" -t $CODECOV_TOKEN From afd43064709ca2f24f2575473a314ea1c25ad023 Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Sat, 25 Oct 2025 16:45:10 +0530 Subject: [PATCH 08/17] test commit --- .github/workflows/tests.yaml | 43 +++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 56a97c1e7..c3239f5ee 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -40,7 +40,8 @@ jobs: run: | echo "Normalizing paths in r-coverage.xml" if [ -f "r-coverage.xml" ]; then - sed -i "s|${GITHUB_WORKSPACE}/||g" r-coverage.xml || true + # Remove file:// prefixes, Windows backslashes, and any common CI workspace prefixes + sed -i -E "s|file:///{0,3}||g; s|\\\\|/|g; s|/home/runner/work/[^/]*/[^/]*/||g; s|/home/runner/work/[^/]*/||g; s|${GITHUB_WORKSPACE}/||g" r-coverage.xml || true echo "First 20 lines of r-coverage.xml:" && head -n 20 r-coverage.xml || true else echo "r-coverage.xml not found" >&2 @@ -103,7 +104,9 @@ jobs: run: | echo "Normalizing JS coverage paths in coverage-istanbul.json" if [ -f "coverage-istanbul.json" ]; then - node -e "const fs=require('fs'); const gw=process.env.GITHUB_WORKSPACE||process.cwd(); const p='coverage-istanbul.json'; const cov=JSON.parse(fs.readFileSync(p)); const out={}; Object.keys(cov).forEach(k=>{ let nk=k; if(nk.startsWith(gw+'/')) nk=nk.slice(gw.length+1); else if(nk.startsWith('file://')){ nk=nk.replace('file://',''); if(nk.startsWith(gw+'/')) nk=nk.slice(gw.length+1);} out[nk]=cov[k]; }); fs.writeFileSync(p, JSON.stringify(out)); console.log('normalized', Object.keys(out).slice(0,3));" + node -e "const fs=require('fs'), path=require('path'); const gw=process.env.GITHUB_WORKSPACE||process.cwd(); const repoName=path.basename(gw); const p='coverage-istanbul.json'; const cov=JSON.parse(fs.readFileSync(p)); const out={}; Object.keys(cov).forEach(k=>{ let nk=k; if(typeof nk!=='string') nk=String(nk); nk=nk.replace(/^file:\/\/+/, ''); nk=nk.replace(/\\\\/g, '/'); // strip any path up to repoName + const idx=nk.indexOf('/'+repoName+'/'); if(idx!==-1) nk=nk.slice(idx+repoName.length+2); // remove leading /repoName/ + nk=nk.replace(new RegExp('^.*/'+repoName+'/', 'g'), ''); nk=nk.replace(new RegExp('^.*/home/runner/work/[^/]*/[^/]*/'), ''); nk=nk.replace(/^\//, ''); out[nk]=cov[k]; }); fs.writeFileSync(p, JSON.stringify(out)); console.log('normalized keys:', Object.keys(out).slice(0,5));" else echo "coverage-istanbul.json not found" >&2 fi @@ -164,6 +167,36 @@ jobs: - name: Show downloaded files run: ls -la artifacts || true + - name: Debug coverage artifacts (sizes & sample paths) + run: | + echo "Artifacts list:" + ls -la artifacts || true + echo + echo "Disk usage:"; du -h artifacts || true + + if [ -f "artifacts/r-coverage.xml" ]; then + echo "\n---- r-coverage.xml (first 120 lines) ----" + head -n 120 artifacts/r-coverage.xml || true + echo "\n---- r-coverage.xml sample filenames ----" + grep -oP 'filename="[^\"]+"' artifacts/r-coverage.xml | sed -E 's/filename="(.*)"/\1/' | head -n 50 || true + elif [ -f "artifacts/r-coverage.lcov" ]; then + echo "\n---- r-coverage.lcov (first 120 lines) ----" + head -n 120 artifacts/r-coverage.lcov || true + echo "\n---- r-coverage.lcov sample SF entries ----" + grep -oP '^SF:.*' artifacts/r-coverage.lcov | sed 's|^SF:||' | head -n 50 || true + else + echo "No R coverage artifact found to inspect" >&2 + fi + + if [ -f "artifacts/coverage-istanbul.json" ]; then + echo "\n---- coverage-istanbul.json size and sample keys ----" + python3 -c "import json; j=json.load(open('artifacts/coverage-istanbul.json')); keys=list(j.keys()); print('entries:', len(keys)); print('\n'.join(keys[:40]))" + else + echo "No JS coverage artifact found to inspect" >&2 + fi + + + - name: Upload combined coverage to Codecov run: | echo "Preparing to upload combined coverage" @@ -184,4 +217,8 @@ jobs: echo "Uploading both files: $R_COV and $JS_COV" curl -Os https://uploader.codecov.io/latest/linux/codecov chmod +x codecov - ./codecov -f "$R_COV" -f "$JS_COV" -t $CODECOV_TOKEN + echo "Running Codecov uploader and saving output to codecov.log" + ./codecov -f "$R_COV" -f "$JS_COV" -t $CODECOV_TOKEN > codecov.log 2>&1 || true + echo "Uploader exit code: $?" + echo "--- codecov.log (first 400 lines) ---" + sed -n '1,400p' codecov.log || true From 53bbce854d8a256760d7c510aecae9e11b549310 Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Sat, 25 Oct 2025 17:43:03 +0530 Subject: [PATCH 09/17] fixed paths --- .github/workflows/tests.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c3239f5ee..6805abfb1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -40,8 +40,10 @@ jobs: run: | echo "Normalizing paths in r-coverage.xml" if [ -f "r-coverage.xml" ]; then - # Remove file:// prefixes, Windows backslashes, and any common CI workspace prefixes - sed -i -E "s|file:///{0,3}||g; s|\\\\|/|g; s|/home/runner/work/[^/]*/[^/]*/||g; s|/home/runner/work/[^/]*/||g; s|${GITHUB_WORKSPACE}/||g" r-coverage.xml || true + # Set sources to repo root so filenames (which are repo-relative) resolve correctly + perl -0777 -pe "s|.*?|.|s" -i r-coverage.xml || true + # Normalize any backslashes that might appear in attributes + sed -i 's|\\\\|/|g' r-coverage.xml || true echo "First 20 lines of r-coverage.xml:" && head -n 20 r-coverage.xml || true else echo "r-coverage.xml not found" >&2 @@ -105,8 +107,10 @@ jobs: echo "Normalizing JS coverage paths in coverage-istanbul.json" if [ -f "coverage-istanbul.json" ]; then node -e "const fs=require('fs'), path=require('path'); const gw=process.env.GITHUB_WORKSPACE||process.cwd(); const repoName=path.basename(gw); const p='coverage-istanbul.json'; const cov=JSON.parse(fs.readFileSync(p)); const out={}; Object.keys(cov).forEach(k=>{ let nk=k; if(typeof nk!=='string') nk=String(nk); nk=nk.replace(/^file:\/\/+/, ''); nk=nk.replace(/\\\\/g, '/'); // strip any path up to repoName - const idx=nk.indexOf('/'+repoName+'/'); if(idx!==-1) nk=nk.slice(idx+repoName.length+2); // remove leading /repoName/ - nk=nk.replace(new RegExp('^.*/'+repoName+'/', 'g'), ''); nk=nk.replace(new RegExp('^.*/home/runner/work/[^/]*/[^/]*/'), ''); nk=nk.replace(/^\//, ''); out[nk]=cov[k]; }); fs.writeFileSync(p, JSON.stringify(out)); console.log('normalized keys:', Object.keys(out).slice(0,5));" + nk = nk.replace(/^\.\//, ''); nk = nk.replace(/^\//, ''); // remove leading 'repoName/' if present + if(nk.startsWith(repoName + '/')) nk = nk.slice(repoName.length + 1); + // strip any path up to '/repoName/' occurrences + nk = nk.replace(new RegExp('^.*/' + repoName + '/'), ''); nk = nk.replace(new RegExp('^.*/home/runner/work/[^/]*/[^/]*/'), ''); nk = nk.replace(/^\//, ''); out[nk]=cov[k]; }); fs.writeFileSync(p, JSON.stringify(out)); console.log('normalized keys:', Object.keys(out).slice(0,5));" else echo "coverage-istanbul.json not found" >&2 fi @@ -195,8 +199,6 @@ jobs: echo "No JS coverage artifact found to inspect" >&2 fi - - - name: Upload combined coverage to Codecov run: | echo "Preparing to upload combined coverage" From 58c00fd83f5a46934e29fc5f3cd92b6d80b1ef30 Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Sat, 25 Oct 2025 18:52:26 +0530 Subject: [PATCH 10/17] actions/checkout@v3 added --- .github/workflows/tests.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 6805abfb1..40b746747 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -168,6 +168,9 @@ jobs: name: js-coverage path: ./artifacts + - name: Checkout repository (needed so Codecov can find source files) + uses: actions/checkout@v3 + - name: Show downloaded files run: ls -la artifacts || true From 3ee5b4b215a8a242782e36d4cb45b0f148f8a5e1 Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Sun, 26 Oct 2025 11:42:38 +0530 Subject: [PATCH 11/17] test commit --- .github/workflows/tests.yaml | 82 +++++++++++------------------------- 1 file changed, 25 insertions(+), 57 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 40b746747..b40c5b057 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -156,74 +156,42 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: + - name: Checkout repository (needed so Codecov can find source files) + uses: actions/checkout@v3 + - name: Download R coverage artifact uses: actions/download-artifact@v4 with: name: r-coverage - path: ./artifacts + path: ./ - name: Download JS coverage artifact uses: actions/download-artifact@v4 with: name: js-coverage - path: ./artifacts - - - name: Checkout repository (needed so Codecov can find source files) - uses: actions/checkout@v3 - - - name: Show downloaded files - run: ls -la artifacts || true + path: ./ - - name: Debug coverage artifacts (sizes & sample paths) + - name: Verify files and paths run: | - echo "Artifacts list:" - ls -la artifacts || true - echo - echo "Disk usage:"; du -h artifacts || true - - if [ -f "artifacts/r-coverage.xml" ]; then - echo "\n---- r-coverage.xml (first 120 lines) ----" - head -n 120 artifacts/r-coverage.xml || true - echo "\n---- r-coverage.xml sample filenames ----" - grep -oP 'filename="[^\"]+"' artifacts/r-coverage.xml | sed -E 's/filename="(.*)"/\1/' | head -n 50 || true - elif [ -f "artifacts/r-coverage.lcov" ]; then - echo "\n---- r-coverage.lcov (first 120 lines) ----" - head -n 120 artifacts/r-coverage.lcov || true - echo "\n---- r-coverage.lcov sample SF entries ----" - grep -oP '^SF:.*' artifacts/r-coverage.lcov | sed 's|^SF:||' | head -n 50 || true - else - echo "No R coverage artifact found to inspect" >&2 - fi - - if [ -f "artifacts/coverage-istanbul.json" ]; then - echo "\n---- coverage-istanbul.json size and sample keys ----" - python3 -c "import json; j=json.load(open('artifacts/coverage-istanbul.json')); keys=list(j.keys()); print('entries:', len(keys)); print('\n'.join(keys[:40]))" - else - echo "No JS coverage artifact found to inspect" >&2 - fi - - - name: Upload combined coverage to Codecov + echo "=== Current directory structure ===" + ls -la + echo "=== Coverage file verification ===" + [ -f "r-coverage.xml" ] && echo "✓ R coverage found" || echo "✗ R coverage missing" + [ -f "coverage-istanbul.json" ] && echo "✓ JS coverage found" || echo "✗ JS coverage missing" + echo "=== Source directory check ===" + [ -d "R" ] && echo "✓ R directory exists" || echo "✗ R directory missing" + [ -d "inst/htmljs" ] && echo "✓ JS source directory exists" || echo "✗ JS source directory missing" + + - name: Upload to Codecov run: | - echo "Preparing to upload combined coverage" - R_COV="" - if [ -f "artifacts/r-coverage.xml" ]; then - R_COV=artifacts/r-coverage.xml - elif [ -f "artifacts/r-coverage.lcov" ]; then - R_COV=artifacts/r-coverage.lcov - fi - JS_COV=artifacts/coverage-istanbul.json - - if [ -z "$R_COV" ] || [ ! -f "$JS_COV" ]; then - echo "Missing one or both coverage files: R=$R_COV JS=$JS_COV" >&2 - ls -la artifacts || true - exit 1 - fi - - echo "Uploading both files: $R_COV and $JS_COV" + echo "Uploading coverage files..." curl -Os https://uploader.codecov.io/latest/linux/codecov chmod +x codecov - echo "Running Codecov uploader and saving output to codecov.log" - ./codecov -f "$R_COV" -f "$JS_COV" -t $CODECOV_TOKEN > codecov.log 2>&1 || true - echo "Uploader exit code: $?" - echo "--- codecov.log (first 400 lines) ---" - sed -n '1,400p' codecov.log || true + + if [ -f "r-coverage.xml" ] && [ -f "coverage-istanbul.json" ]; then + ./codecov -f "r-coverage.xml" -f "coverage-istanbul.json" -t $CODECOV_TOKEN + else + echo "Missing coverage files:" + ls -la *.xml *.json 2>/dev/null || true + exit 1 + fi \ No newline at end of file From 7fbb434c7c1c75ac6bd1759bf3f08cd2dacd016a Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Sun, 26 Oct 2025 12:47:14 +0530 Subject: [PATCH 12/17] cleanup --- .github/workflows/tests.yaml | 60 ++++++------------------------------ 1 file changed, 9 insertions(+), 51 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b40c5b057..e2eda2fc8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,7 +13,6 @@ jobs: TEST_SUITE: R_coverage GITHUB_PAT: ${{ secrets.PAT_GITHUB }} GH_ACTION: "ENABLED" - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - uses: actions/checkout@v3 - name: install and update texlive @@ -31,23 +30,17 @@ jobs: - name: git config user.email run: git config --global user.email toby.hocking@r-project.org - - name: Run R tests and write lcov + - name: Run R tests and generate coverage run: | - echo "Generating R test coverage lcov file" - Rscript -e "if (!requireNamespace('covr', quietly=TRUE)) install.packages('covr'); library(covr); cov <- covr::package_coverage(path='.', type='tests'); covr::to_cobertura(cov, file='r-coverage.xml')" + Rscript -e "if (!requireNamespace('covr', quietly=TRUE)) install.packages('covr'); cov <- covr::package_coverage(type='tests'); covr::to_cobertura(cov, file='r-coverage.xml')" - name: Normalize R coverage paths run: | - echo "Normalizing paths in r-coverage.xml" if [ -f "r-coverage.xml" ]; then - # Set sources to repo root so filenames (which are repo-relative) resolve correctly - perl -0777 -pe "s|.*?|.|s" -i r-coverage.xml || true - # Normalize any backslashes that might appear in attributes - sed -i 's|\\\\|/|g' r-coverage.xml || true - echo "First 20 lines of r-coverage.xml:" && head -n 20 r-coverage.xml || true - else - echo "r-coverage.xml not found" >&2 + perl -0777 -pe "s|.*?|.|s" -i r-coverage.xml + sed -i 's|\\\\|/|g' r-coverage.xml fi + - name: Upload R coverage artifact uses: actions/upload-artifact@v4 with: @@ -61,7 +54,6 @@ jobs: TEST_SUITE: JS_coverage GITHUB_PAT: ${{ secrets.PAT_GITHUB }} GH_ACTION: "ENABLED" - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - uses: actions/checkout@v3 - name: install and update texlive @@ -84,12 +76,10 @@ jobs: with: node-version: '18' - name: Install Node.js dependencies + run: npm install v8-to-istanbul + + - name: Run JS tests and convert coverage run: | - npm install v8-to-istanbul - echo "Node modules installed" - - name: Run JS tests (R + JS coverage collection) - run: | - echo "Running testthat with JS coverage collection..." Rscript -e "source('tests/testthat.R', chdir = TRUE)" - name: Convert JS coverage to Istanbul format @@ -102,19 +92,6 @@ jobs: exit 1 fi - - name: Normalize JS coverage paths - run: | - echo "Normalizing JS coverage paths in coverage-istanbul.json" - if [ -f "coverage-istanbul.json" ]; then - node -e "const fs=require('fs'), path=require('path'); const gw=process.env.GITHUB_WORKSPACE||process.cwd(); const repoName=path.basename(gw); const p='coverage-istanbul.json'; const cov=JSON.parse(fs.readFileSync(p)); const out={}; Object.keys(cov).forEach(k=>{ let nk=k; if(typeof nk!=='string') nk=String(nk); nk=nk.replace(/^file:\/\/+/, ''); nk=nk.replace(/\\\\/g, '/'); // strip any path up to repoName - nk = nk.replace(/^\.\//, ''); nk = nk.replace(/^\//, ''); // remove leading 'repoName/' if present - if(nk.startsWith(repoName + '/')) nk = nk.slice(repoName.length + 1); - // strip any path up to '/repoName/' occurrences - nk = nk.replace(new RegExp('^.*/' + repoName + '/'), ''); nk = nk.replace(new RegExp('^.*/home/runner/work/[^/]*/[^/]*/'), ''); nk = nk.replace(/^\//, ''); out[nk]=cov[k]; }); fs.writeFileSync(p, JSON.stringify(out)); console.log('normalized keys:', Object.keys(out).slice(0,5));" - else - echo "coverage-istanbul.json not found" >&2 - fi - - name: Upload JS coverage artifact uses: actions/upload-artifact@v4 with: @@ -171,27 +148,8 @@ jobs: name: js-coverage path: ./ - - name: Verify files and paths - run: | - echo "=== Current directory structure ===" - ls -la - echo "=== Coverage file verification ===" - [ -f "r-coverage.xml" ] && echo "✓ R coverage found" || echo "✗ R coverage missing" - [ -f "coverage-istanbul.json" ] && echo "✓ JS coverage found" || echo "✗ JS coverage missing" - echo "=== Source directory check ===" - [ -d "R" ] && echo "✓ R directory exists" || echo "✗ R directory missing" - [ -d "inst/htmljs" ] && echo "✓ JS source directory exists" || echo "✗ JS source directory missing" - - name: Upload to Codecov run: | - echo "Uploading coverage files..." curl -Os https://uploader.codecov.io/latest/linux/codecov chmod +x codecov - - if [ -f "r-coverage.xml" ] && [ -f "coverage-istanbul.json" ]; then - ./codecov -f "r-coverage.xml" -f "coverage-istanbul.json" -t $CODECOV_TOKEN - else - echo "Missing coverage files:" - ls -la *.xml *.json 2>/dev/null || true - exit 1 - fi \ No newline at end of file + ./codecov -f "r-coverage.xml" -f "coverage-istanbul.json" -t $CODECOV_TOKEN \ No newline at end of file From fcc60795318acc7240d5db03088cef38185116fc Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Sun, 26 Oct 2025 13:29:11 +0530 Subject: [PATCH 13/17] test commit --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e2eda2fc8..5695d9c54 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -32,7 +32,7 @@ jobs: - name: Run R tests and generate coverage run: | - Rscript -e "if (!requireNamespace('covr', quietly=TRUE)) install.packages('covr'); cov <- covr::package_coverage(type='tests'); covr::to_cobertura(cov, file='r-coverage.xml')" + Rscript -e "if (!requireNamespace('covr', quietly=TRUE)) install.packages('covr'); cov <- covr::package_coverage(type='tests', test_files = "tests/testthat.R"); covr::to_cobertura(cov, file='r-coverage.xml')" - name: Normalize R coverage paths run: | From 8a2c8b6db715a9f4b6835af1bee60f9ffdc7824f Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Fri, 31 Oct 2025 13:47:21 +0530 Subject: [PATCH 14/17] removed unnecessary actions in R and JS coverage workflow --- .github/workflows/tests.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5695d9c54..23f8ea661 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,9 +15,6 @@ jobs: GH_ACTION: "ENABLED" steps: - uses: actions/checkout@v3 - - name: install and update texlive - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq - - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt install tidy texlive texlive-fonts-extra -y - uses: r-lib/actions/setup-r@v2 - uses: r-lib/actions/setup-r-dependencies@v2 @@ -56,9 +53,6 @@ jobs: GH_ACTION: "ENABLED" steps: - uses: actions/checkout@v3 - - name: install and update texlive - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq - - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt install tidy texlive texlive-fonts-extra -y - uses: r-lib/actions/setup-r@v2 - uses: r-lib/actions/setup-r-dependencies@v2 From 4be6d2845c21ab7603ab3615e3ac3e05ca9c369f Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Fri, 31 Oct 2025 14:00:11 +0530 Subject: [PATCH 15/17] Rscript changes --- .github/workflows/tests.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 23f8ea661..acfc9ff09 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -34,8 +34,12 @@ jobs: - name: Normalize R coverage paths run: | if [ -f "r-coverage.xml" ]; then - perl -0777 -pe "s|.*?|.|s" -i r-coverage.xml - sed -i 's|\\\\|/|g' r-coverage.xml + Rscript -e " + content <- paste(readLines('r-coverage.xml', warn = FALSE), collapse='\n') + content <- gsub('.*?', '.', content) + content <- gsub('\\\\\\\\', '/', content) + writeLines(content, 'r-coverage.xml') + " fi - name: Upload R coverage artifact From c4c6d4d48e20bd69f1ce575bc2534b53835f6330 Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Fri, 31 Oct 2025 14:04:46 +0530 Subject: [PATCH 16/17] updated NEWS and version++ --- DESCRIPTION | 2 +- NEWS.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 95ed405f8..0ba379a55 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: animint2 Title: Animated Interactive Grammar of Graphics -Version: 2025.10.27 +Version: 2025.10.31 URL: https://animint.github.io/animint2 BugReports: https://github.com/animint/animint2/issues Authors@R: c( diff --git a/NEWS.md b/NEWS.md index d75223336..fe058915f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# Changes in version 2025.10.31 (PR#260) + +- Ensures R and JS coverage reports are uploaded together to prevent partial coverage data +- Upload only occurs when both test suites pass, avoiding skewed coverage comparisons + # Changes in version 2025.10.27 (PR#269) - `geom_point()` default shape changed from 19 to 21 to enable both color and fill aesthetics for more consistent static rendering. From 1620d93dd30497cb981561755b6d38abc71416d5 Mon Sep 17 00:00:00 2001 From: Suhaani Agarwal Date: Fri, 31 Oct 2025 19:53:19 +0530 Subject: [PATCH 17/17] added back texlive steps to R and JS coverage workflows --- .github/workflows/tests.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index acfc9ff09..72db1f8f7 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,6 +15,9 @@ jobs: GH_ACTION: "ENABLED" steps: - uses: actions/checkout@v3 + - name: install and update texlive + run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq + - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt install tidy texlive texlive-fonts-extra -y - uses: r-lib/actions/setup-r@v2 - uses: r-lib/actions/setup-r-dependencies@v2 @@ -57,6 +60,9 @@ jobs: GH_ACTION: "ENABLED" steps: - uses: actions/checkout@v3 + - name: install and update texlive + run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt update -y -qq + - run: /usr/bin/sudo DEBIAN_FRONTEND=noninteractive apt install tidy texlive texlive-fonts-extra -y - uses: r-lib/actions/setup-r@v2 - uses: r-lib/actions/setup-r-dependencies@v2