From c2a45fa67f8e515c759b16810444484e4ff05bb6 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Tue, 24 Sep 2024 23:17:50 -0700 Subject: [PATCH 1/8] Revert "Disable covr (#6122)" This reverts commit 3130f11bc05d1609ee5373613b675f8890befba2. --- .github/workflows/test-coverage.yaml | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/test-coverage.yaml diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 000000000..982cb7c81 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,44 @@ +on: + push: + branches: + - master + pull_request: + +name: test-coverage + +jobs: + test-coverage: + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@v2 + + - uses: r-lib/actions/setup-pandoc@v2 + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Restore R package cache + uses: actions/cache@v2 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install dependencies + run: | + install.packages(c("remotes")) + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("covr") + shell: Rscript {0} + + - name: Test coverage + run: covr::codecov() + shell: Rscript {0} From ab676f475f6fa32f8b91ab74e64469b25f98db02 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Tue, 24 Sep 2024 23:21:06 -0700 Subject: [PATCH 2/8] pin R 4.3 with TODO --- .github/workflows/test-coverage.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 982cb7c81..be299049e 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -15,6 +15,8 @@ jobs: - uses: actions/checkout@v2 - uses: r-lib/actions/setup-r@v2 + with: + r-version: '4.3' # TODO(r-lib/covr#567): Go back to using r-devel - uses: r-lib/actions/setup-pandoc@v2 From a17810654aacc36a6ba9e205131676f5382bbca3 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Tue, 24 Sep 2024 23:28:04 -0700 Subject: [PATCH 3/8] Try a pinned covr version --- .github/workflows/test-coverage.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index be299049e..3583a07fe 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -36,9 +36,9 @@ jobs: - name: Install dependencies run: | - install.packages(c("remotes")) + install.packages("remotes") remotes::install_deps(dependencies = TRUE) - remotes::install_cran("covr") + remotes::install_version("covr", "3.6.3") # TODO(r-lib/covr#567): Go back to just installing CRAN covr shell: Rscript {0} - name: Test coverage From e0a65f551003433b7f06c65d01cef7ad01fb411e Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Tue, 24 Sep 2024 23:32:43 -0700 Subject: [PATCH 4/8] go further back --- .github/workflows/test-coverage.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 3583a07fe..02d2d8742 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -16,7 +16,7 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: - r-version: '4.3' # TODO(r-lib/covr#567): Go back to using r-devel + r-version: '4.2' # TODO(r-lib/covr#567): Go back to using r-devel - uses: r-lib/actions/setup-pandoc@v2 @@ -38,7 +38,7 @@ jobs: run: | install.packages("remotes") remotes::install_deps(dependencies = TRUE) - remotes::install_version("covr", "3.6.3") # TODO(r-lib/covr#567): Go back to just installing CRAN covr + remotes::install_version("covr", "3.6.2") # TODO(r-lib/covr#567): Go back to just installing CRAN covr shell: Rscript {0} - name: Test coverage From 793bc06d518d6e1532e8b10eeb9f05cf52ba5f22 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Tue, 24 Sep 2024 23:36:48 -0700 Subject: [PATCH 5/8] Use cribbed updated covr action? --- .github/workflows/test-coverage.yaml | 62 ++++++++++++++++------------ 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 02d2d8742..b8fa6a107 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,46 +1,54 @@ +# 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: - - master + branches: [master] pull_request: + branches: [master] -name: test-coverage +name: test-coverage.yaml + +permissions: read-all jobs: test-coverage: - runs-on: macOS-latest + runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: - r-version: '4.2' # TODO(r-lib/covr#567): Go back to using r-devel - - - uses: r-lib/actions/setup-pandoc@v2 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} + use-public-rspm: true - - name: Restore R package cache - uses: actions/cache@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + extra-packages: any::covr, any::xml2 + needs: coverage - - name: Install dependencies + - name: Test coverage run: | - install.packages("remotes") - remotes::install_deps(dependencies = TRUE) - remotes::install_version("covr", "3.6.2") # TODO(r-lib/covr#567): Go back to just installing CRAN covr + cov <- covr::package_coverage( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) + covr::to_cobertura(cov) shell: Rscript {0} - - name: Test coverage - run: covr::codecov() - shell: Rscript {0} + - uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} + file: ./cobertura.xml + plugin: noop + disable_search: true + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package From 1bc5db50b61dc3900de077db73ebf156307e464c Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Tue, 24 Sep 2024 23:47:30 -0700 Subject: [PATCH 6/8] Not crashing, but very slow; try pinned version again --- .github/workflows/test-coverage.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index b8fa6a107..79fcd6fdc 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -22,6 +22,7 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true + r-version: '4.3' # TODO(r-lib/covr#567): Go back to using r-devel - uses: r-lib/actions/setup-r-dependencies@v2 with: From c7fac201384eda6a8f64b4e3f9ff2212fcdc4a76 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Wed, 25 Sep 2024 07:26:31 -0700 Subject: [PATCH 7/8] we don't have secrets set up --- .github/workflows/test-coverage.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 79fcd6fdc..57133d44c 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -45,7 +45,6 @@ jobs: file: ./cobertura.xml plugin: noop disable_search: true - token: ${{ secrets.CODECOV_TOKEN }} - name: Upload test results if: failure() From 25b0de9c4b684de7130eedc7494bb6ab75901af9 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Wed, 25 Sep 2024 08:45:22 -0700 Subject: [PATCH 8/8] Added a repo secret to data.table (I think) --- .github/workflows/test-coverage.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 57133d44c..79fcd6fdc 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -45,6 +45,7 @@ jobs: file: ./cobertura.xml plugin: noop disable_search: true + token: ${{ secrets.CODECOV_TOKEN }} - name: Upload test results if: failure()