From 086b65637f7fbc23cd48e75579f07e54fce5a3be Mon Sep 17 00:00:00 2001 From: Julia Silge Date: Tue, 28 May 2024 12:49:42 -0600 Subject: [PATCH] Maintenance on GH actions --- .github/workflows/R-CMD-check-hard.yaml | 2 +- .github/workflows/R-CMD-check.yaml | 6 +++--- .github/workflows/pkgdown.yaml | 6 +++--- .github/workflows/pr-commands.yaml | 4 ++-- .github/workflows/test-coverage.yaml | 24 +++++++++++++++++------- 5 files changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/R-CMD-check-hard.yaml b/.github/workflows/R-CMD-check-hard.yaml index 1ac2a50..feda3de 100644 --- a/.github/workflows/R-CMD-check-hard.yaml +++ b/.github/workflows/R-CMD-check-hard.yaml @@ -31,7 +31,7 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 2462e07..66ed035 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -36,7 +36,7 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -58,13 +58,13 @@ jobs: - name: Install Miniconda # conda can fail at downgrading python, so we specify python version in advance env: - RETICULATE_MINICONDA_PYTHON_VERSION: "3.7" + RETICULATE_MINICONDA_PYTHON_VERSION: "3.10" run: reticulate::install_miniconda() # creates r-reticulate conda env by default shell: Rscript {0} - name: Install TensorFlow run: | - tensorflow::install_tensorflow(version='2.7', conda_python_version = NULL) + tensorflow::install_tensorflow(conda_python_version = NULL) shell: Rscript {0} - uses: r-lib/actions/check-r-package@v2 diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 6f27835..c4b2df2 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -22,7 +22,7 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -42,13 +42,13 @@ jobs: - name: Install Miniconda # conda can fail at downgrading python, so we specify python version in advance env: - RETICULATE_MINICONDA_PYTHON_VERSION: "3.7" + RETICULATE_MINICONDA_PYTHON_VERSION: "3.10" run: reticulate::install_miniconda() # creates r-reticulate conda env by default shell: Rscript {0} - name: Install TensorFlow run: | - tensorflow::install_tensorflow(version='2.7', conda_python_version = NULL) + tensorflow::install_tensorflow(conda_python_version = NULL) shell: Rscript {0} - name: Build site diff --git a/.github/workflows/pr-commands.yaml b/.github/workflows/pr-commands.yaml index 71f335b..eea58c5 100644 --- a/.github/workflows/pr-commands.yaml +++ b/.github/workflows/pr-commands.yaml @@ -14,7 +14,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/pr-fetch@v2 with: @@ -51,7 +51,7 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/pr-fetch@v2 with: diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 2bb57b4..709f9e7 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -15,7 +15,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: @@ -33,34 +33,44 @@ jobs: - name: Install Miniconda # conda can fail at downgrading python, so we specify python version in advance env: - RETICULATE_MINICONDA_PYTHON_VERSION: "3.7" + RETICULATE_MINICONDA_PYTHON_VERSION: "3.10" run: reticulate::install_miniconda() # creates r-reticulate conda env by default shell: Rscript {0} - name: Install TensorFlow run: | - tensorflow::install_tensorflow(version='2.7', conda_python_version = NULL) + tensorflow::install_tensorflow(conda_python_version = NULL) shell: Rscript {0} - name: Test coverage run: | - covr::codecov( + 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} + - 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: Show testthat output if: always() run: | ## -------------------------------------------------------------------- - find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true + find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true shell: bash - name: Upload test results if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-test-failures - path: ${{ runner.temp }}/package \ No newline at end of file + path: ${{ runner.temp }}/package + \ No newline at end of file