Skip to content

Commit

Permalink
Maintenance on GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasilge committed May 28, 2024
1 parent d6d6cf1 commit 086b656
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check-hard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
path: ${{ runner.temp }}/package

0 comments on commit 086b656

Please sign in to comment.