Skip to content

Commit

Permalink
Add epinowcast/actions/install-cmdstan + pgdown as env object (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
seabbs authored May 21, 2024
1 parent 091e142 commit 03cac6f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 37 deletions.
31 changes: 8 additions & 23 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
merge_group:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

name: R-CMD-check

jobs:
Expand All @@ -36,25 +40,7 @@ jobs:
NOT_CRAN: true

steps:
- name: cmdstan env vars
run: |
echo "CMDSTAN_PATH=${HOME}/.cmdstan" >> $GITHUB_ENV
shell: bash

- uses: n1hility/cancel-previous-runs@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"

- uses: actions/checkout@v4

- name: Install cmdstan Linux system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev || true
sudo apt-get install -y openmpi-bin openmpi-common libopenmpi-dev || true
sudo apt-get install -y libpng-dev || true

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

Expand All @@ -71,11 +57,10 @@ jobs:
needs: check

- name: Install cmdstan
run: |
print(list.files("C:/rtools43"))
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:
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/build-and-push-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches: ['release', 'main']

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
Expand All @@ -16,12 +20,6 @@ jobs:
packages: write

steps:

- name: Cancel previous builds if present
uses: n1hility/cancel-previous-runs@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout repository
uses: actions/checkout@v4

Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,22 @@ jobs:
needs: website

- 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: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Upload website
uses: actions/upload-artifact@v4
with:
name: website
retention-days: 5
path: docs

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
workflow_dispatch:
merge_group:


name: test-coverage

jobs:
Expand All @@ -31,10 +32,10 @@ jobs:
needs: coverage

- 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: Test coverage
run: covr::codecov(quiet = FALSE)
Expand Down

0 comments on commit 03cac6f

Please sign in to comment.