From 95c36430dca62d40e57a3bf3968b488983891d93 Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Fri, 27 Sep 2024 13:15:34 -0400 Subject: [PATCH] Update actions (#769) * update actions * update `simulate_*` snapshots (#780) * install rstan from CRAN explicitly (#782) * use github version for cmdstanr * Revert "update `simulate_*` snapshots (#780)" This reverts commit a21fbf8c08ac5124f3d39a39c5214808a000c12a. * setup pandoc * use epinowcast action --------- Co-authored-by: Sebastian Funk --- .github/workflows/R-CMD-as-cran-check.yaml | 11 +++++------ .github/workflows/R-CMD-check.yaml | 11 +++++------ .github/workflows/lint-only-changed-files.yaml | 4 +--- .github/workflows/pkgdown.yaml | 4 +--- .github/workflows/stan-model-benchmark.yaml | 11 +++++------ .github/workflows/test-coverage.yaml | 18 ++++++++++++------ DESCRIPTION | 2 +- 7 files changed, 30 insertions(+), 31 deletions(-) diff --git a/.github/workflows/R-CMD-as-cran-check.yaml b/.github/workflows/R-CMD-as-cran-check.yaml index 944dc17f9..a2251fbf8 100644 --- a/.github/workflows/R-CMD-as-cran-check.yaml +++ b/.github/workflows/R-CMD-as-cran-check.yaml @@ -34,7 +34,6 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - extra-repositories: https://mc-stan.org/r-packages/ - uses: r-lib/actions/setup-r-dependencies@v2 with: @@ -42,14 +41,14 @@ jobs: extra-packages: | rcmdcheck rmarkdown - cmdstanr + stan-dev/cmdstanr testthat - name: Install cmdstan - run: | - cmdstanr::check_cmdstan_toolchain(fix = TRUE) - cmdstanr::install_cmdstan(cores = 2, quiet = TRUE) - shell: Rscript {0} + uses: epinowcast/actions/install-cmdstan@v1 + with: + cmdstan-version: 'latest' + num-cores: 2 - uses: r-lib/actions/check-r-package@v2 with: diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 3ec272672..a9480b4bb 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -55,7 +55,6 @@ jobs: r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true - extra-repositories: https://mc-stan.org/r-packages/ - uses: r-lib/actions/setup-r-dependencies@v2 with: @@ -63,15 +62,15 @@ jobs: extra-packages: | rmarkdown rcmdcheck - cmdstanr + stan-dev/cmdstanr testthat - name: Install cmdstan if: runner.os != 'Windows' - run: | - cmdstanr::check_cmdstan_toolchain(fix = TRUE) - cmdstanr::install_cmdstan(cores = 2, quiet = TRUE) - shell: Rscript {0} + uses: epinowcast/actions/install-cmdstan@v1 + with: + cmdstan-version: 'latest' + num-cores: 2 - uses: r-lib/actions/check-r-package@v2 with: diff --git a/.github/workflows/lint-only-changed-files.yaml b/.github/workflows/lint-only-changed-files.yaml index 4360134dc..3d67b098d 100644 --- a/.github/workflows/lint-only-changed-files.yaml +++ b/.github/workflows/lint-only-changed-files.yaml @@ -18,8 +18,6 @@ jobs: - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 - with: - extra-repositories: https://mc-stan.org/r-packages/ - uses: r-lib/actions/setup-r-dependencies@v2 with: @@ -27,7 +25,7 @@ jobs: extra-packages: | here usethis - cmdstanr + stan-dev/cmdstanr any::gh any::lintr any::purrr diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 19d0e788e..6a39359a7 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -28,9 +28,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: dependencies: NA - extra-packages: | - epiforecasts/EpiNow2 - pkgdown + extra-packages: pkgdown local::. - name: Build site run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) diff --git a/.github/workflows/stan-model-benchmark.yaml b/.github/workflows/stan-model-benchmark.yaml index 921873aaa..fae8ab121 100644 --- a/.github/workflows/stan-model-benchmark.yaml +++ b/.github/workflows/stan-model-benchmark.yaml @@ -24,7 +24,6 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - extra-repositories: https://mc-stan.org/r-packages/ - uses: r-lib/actions/setup-r-dependencies@v2 with: @@ -32,13 +31,13 @@ jobs: local::. here purrr - cmdstanr + stan-dev/cmdstanr - name: Install cmdstan - run: | - cmdstanr::check_cmdstan_toolchain(fix = TRUE) - cmdstanr::install_cmdstan(cores = 2, quiet = TRUE) - shell: Rscript {0} + uses: epinowcast/actions/install-cmdstan@v1 + with: + cmdstan-version: 'latest' + num-cores: 2 - name: Checkout main branch in parallel and move to separate dir run: | diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index dad0a0246..80a3dc9fd 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -10,6 +10,10 @@ on: name: test-coverage +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test-coverage: runs-on: macos-latest @@ -21,24 +25,26 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: r-lib/actions/setup-pandoc@v2 + - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - extra-repositories: https://mc-stan.org/r-packages/ - uses: r-lib/actions/setup-r-dependencies@v2 with: dependencies: NA extra-packages: | covr - cmdstanr + stan-dev/cmdstanr testthat - name: Install cmdstan - run: | - cmdstanr::check_cmdstan_toolchain(fix = TRUE) - cmdstanr::install_cmdstan(cores = 2, quiet = TRUE) - shell: Rscript {0} + if: runner.os != 'Windows' + uses: epinowcast/actions/install-cmdstan@v1 + with: + cmdstan-version: 'latest' + num-cores: 2 - name: Test coverage run: covr::codecov(quiet = FALSE) diff --git a/DESCRIPTION b/DESCRIPTION index 0ad0fc252..e755bf6eb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -142,7 +142,7 @@ LinkingTo: rstan (>= 2.26.0), StanHeaders (>= 2.26.0) Additional_repositories: - https://mc-stan.org/r-packages/ + https://stan-dev.r-universe.dev Biarch: true Config/testthat/edition: 3 Encoding: UTF-8