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