Skip to content

Commit

Permalink
test: updated gha
Browse files Browse the repository at this point in the history
  • Loading branch information
kapsner committed Oct 15, 2024
1 parent 87420c7 commit 9f6addc
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: quarto-dev/quarto-actions/setup@v2
with:
Expand All @@ -56,32 +56,30 @@ jobs:
r-version: ${{ matrix.config.r }}
Ncpus: 4


- name: Install sys deps for Ubuntu
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install -y libgit2-dev libcurl4-openssl-dev

# set date/week for use in cache creation
# https://github.community/t5/GitHub-Actions/How-to-set-and-access-a-Workflow-variable/m-p/42970
# - cache R packages daily
- name: "[Cache] Prepare daily timestamp for cache"
if: runner.os != 'Windows'
id: date
run: echo "::set-output name=date::$(date '+%d-%m')"
run: echo "date=$(date '+%d-%m')" >> $GITHUB_OUTPUT

- name: "[Cache] Cache R packages"
- name: "[Cache] Restore R package cache"
if: runner.os != 'Windows'
uses: pat-s/always-upload-cache@main
uses: actions/cache/restore@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}

# for some strange Windows reason this step and the next one need to be decoupled
- name: "[Stage] Prepare"
run: |
Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')"
Rscript -e "if (getRversion() < '3.2' && !requireNamespace('curl')) install.packages('curl', type = 'source')"

- name: "[Stage] Install pak"
run: Rscript -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/stable')"

- name: "[Stage] [Linux] Install curl"
if: runner.os == 'Linux'
run: sudo apt install libcurl4-openssl-dev
- name: "[Stage] Install"
run: Rscript -e "install.packages('tic', repos = c('https://ropensci.r-universe.dev', if (grepl('Ubuntu', Sys.info()[['version']])) {sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))} else {'https://cloud.r-project.org'}))" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()"

- name: Install dependencies
run: |
Expand Down

0 comments on commit 9f6addc

Please sign in to comment.