From 2d653d3e7bc0b58373ef22c1aba0dbec2afb5212 Mon Sep 17 00:00:00 2001 From: Zac Davies Date: Wed, 24 Dec 2025 17:23:38 +1100 Subject: [PATCH 1/8] updating codecov action --- .Rbuildignore | 1 + .github/workflows/test-coverage.yaml | 40 ++++++++++++++++++++++--- README.md | 6 ++-- databricks.api.Rproj => brickster.Rproj | 0 codecov.yml | 14 +++++++++ 5 files changed, 54 insertions(+), 7 deletions(-) rename databricks.api.Rproj => brickster.Rproj (100%) create mode 100644 codecov.yml diff --git a/.Rbuildignore b/.Rbuildignore index d353a907..11d61ae9 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -13,3 +13,4 @@ ^CLAUDE.md ^\.claude ^gifs +^codecov\.yml$ diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 735e5ab5..8988207e 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,12 +1,13 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: branches: [main, master] pull_request: branches: [main, master] +name: test-coverage.yaml -name: test-coverage +permissions: read-all jobs: test-coverage: @@ -29,7 +30,8 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: covr + extra-packages: any::covr, any::xml2 + needs: coverage - name: Create and populate .Renviron file run: | @@ -39,5 +41,35 @@ jobs: shell: bash - name: Test coverage - run: covr::codecov(token = "${{ secrets.CODECOV_TOKEN }}") + run: | + cov <- covr::package_coverage( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) + print(cov) + covr::to_cobertura(cov) shell: Rscript {0} + + - uses: codecov/codecov-action@v5 + with: + # Fail if error if not on PR, or if on PR and token is given + fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }} + files: ./cobertura.xml + plugins: noop + disable_search: true + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/README.md b/README.md index 12179589..903c386d 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![R-CMD-check](https://github.com/databrickslabs/brickster/workflows/R-CMD-check/badge.svg)](https://github.com/databrickslabs/brickster/actions) [![Codecov test coverage](https://codecov.io/gh/databrickslabs/brickster/branch/main/graph/badge.svg)](https://app.codecov.io/gh/databrickslabs/brickster?branch=main) - +[![R-CMD-check](https://github.com/databrickslabs/brickster/workflows/R-CMD-check/badge.svg)](https://github.com/databrickslabs/brickster/actions) +[![Codecov test coverage](https://codecov.io/gh/databrickslabs/brickster/graph/badge.svg)](https://app.codecov.io/gh/databrickslabs/brickster) ## Overview @@ -142,4 +142,4 @@ pak::pak("databrickslabs/brickster") | [REST 1.2 Commands](https://docs.databricks.com/api/workspace/commandexecution) | Partially | 1.2 | | [Unity Catalog - Tables](https://docs.databricks.com/api/workspace/tables) | Yes | 2.1 | | [Unity Catalog - Volumes](https://docs.databricks.com/api/workspace/volumes) | Yes | 2.1 | -| [Unity Catalog](https://docs.databricks.com/api/workspace/catalogs) | Partially | 2.1 | \ No newline at end of file +| [Unity Catalog](https://docs.databricks.com/api/workspace/catalogs) | Partially | 2.1 | diff --git a/databricks.api.Rproj b/brickster.Rproj similarity index 100% rename from databricks.api.Rproj rename to brickster.Rproj diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..04c55859 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,14 @@ +comment: false + +coverage: + status: + project: + default: + target: auto + threshold: 1% + informational: true + patch: + default: + target: auto + threshold: 1% + informational: true From ff69d19ff1df4e1d92bc40121c14ef87416cefc8 Mon Sep 17 00:00:00 2001 From: Zac Davies Date: Wed, 24 Dec 2025 18:25:15 +1100 Subject: [PATCH 2/8] fetch depth test --- .github/workflows/test-coverage.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 8988207e..f8c31750 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -23,6 +23,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: r-lib/actions/setup-r@v2 with: @@ -59,6 +61,7 @@ jobs: plugins: noop disable_search: true token: ${{ secrets.CODECOV_TOKEN }} + verbose: true - name: Show testthat output if: always() From 864db99bfbc6ef88c7edba80a9baf27840efd5ec Mon Sep 17 00:00:00 2001 From: Zac Davies Date: Wed, 24 Dec 2025 18:36:38 +1100 Subject: [PATCH 3/8] oidc codecov option --- .github/workflows/test-coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index f8c31750..ec036f22 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -60,7 +60,7 @@ jobs: files: ./cobertura.xml plugins: noop disable_search: true - token: ${{ secrets.CODECOV_TOKEN }} + use_oidc: true verbose: true - name: Show testthat output From 5447b7e818013237f34369b815edb008921a4be3 Mon Sep 17 00:00:00 2001 From: Zac Davies Date: Wed, 24 Dec 2025 18:45:42 +1100 Subject: [PATCH 4/8] perms change --- .github/workflows/test-coverage.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index ec036f22..3a369a59 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -7,7 +7,9 @@ on: branches: [main, master] name: test-coverage.yaml -permissions: read-all +permissions: + contents: read + id-token: write jobs: test-coverage: From f51ad1b2aac1c117d101da3c75cd80c1540d6b39 Mon Sep 17 00:00:00 2001 From: Zac Davies Date: Wed, 24 Dec 2025 19:02:25 +1100 Subject: [PATCH 5/8] debugging --- .github/workflows/test-coverage.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 3a369a59..81ce8ee8 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -55,6 +55,13 @@ jobs: covr::to_cobertura(cov) shell: Rscript {0} + - name: Inspect cobertura paths + run: | + echo "=== first 80 lines ===" + head -n 80 cobertura.xml + echo "=== file entries (sample) ===" + grep -Eo 'filename="[^"]+"' cobertura.xml | head -n 40 + - uses: codecov/codecov-action@v5 with: # Fail if error if not on PR, or if on PR and token is given From d644501439a4c5bac17f93f7f147551294ba7b7d Mon Sep 17 00:00:00 2001 From: Zac Davies Date: Wed, 24 Dec 2025 19:35:33 +1100 Subject: [PATCH 6/8] changing env vars --- .github/workflows/test-coverage.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 81ce8ee8..d4f58be5 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -37,14 +37,12 @@ jobs: extra-packages: any::covr, any::xml2 needs: coverage - - name: Create and populate .Renviron file - run: | - echo DATABRICKS_HOST="$DATABRICKS_HOST" >> ~/.Renviron - echo DATABRICKS_TOKEN="$DATABRICKS_TOKEN" >> ~/.Renviron - echo DATABRICKS_WSID="$DATABRICKS_WSID" >> ~/.Renviron - shell: bash - - name: Test coverage + env: + DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }} + DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }} + DATABRICKS_WSID: ${{ secrets.DATABRICKS_WSID }} + NOT_CRAN: true run: | cov <- covr::package_coverage( quiet = FALSE, From 2a45cc6786209c52a0805d43a5eb1fe9f1a613db Mon Sep 17 00:00:00 2001 From: Zac Davies Date: Wed, 24 Dec 2025 22:05:15 +1100 Subject: [PATCH 7/8] clean up git actions --- .github/workflows/test-coverage.yaml | 8 -------- brickster.Rproj | 1 + 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index d4f58be5..825cabdd 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -53,13 +53,6 @@ jobs: covr::to_cobertura(cov) shell: Rscript {0} - - name: Inspect cobertura paths - run: | - echo "=== first 80 lines ===" - head -n 80 cobertura.xml - echo "=== file entries (sample) ===" - grep -Eo 'filename="[^"]+"' cobertura.xml | head -n 40 - - uses: codecov/codecov-action@v5 with: # Fail if error if not on PR, or if on PR and token is given @@ -68,7 +61,6 @@ jobs: plugins: noop disable_search: true use_oidc: true - verbose: true - name: Show testthat output if: always() diff --git a/brickster.Rproj b/brickster.Rproj index 8317401b..b0fb3e73 100644 --- a/brickster.Rproj +++ b/brickster.Rproj @@ -20,4 +20,5 @@ LineEndingConversion: Posix BuildType: Package PackageUseDevtools: Yes PackageInstallArgs: --no-multiarch --with-keep.source +PackageCheckArgs: --as-cran PackageRoxygenize: rd,collate,namespace,vignette From 18a5a076d15268353cc4ab8109d45682060dccab Mon Sep 17 00:00:00 2001 From: Zac Davies Date: Wed, 24 Dec 2025 22:20:00 +1100 Subject: [PATCH 8/8] remove empty zzz.R --- R/zzz.R | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 R/zzz.R diff --git a/R/zzz.R b/R/zzz.R deleted file mode 100644 index e69de29b..00000000