From 9f6addc9fd739f7c59cd3be83d401c659f57de70 Mon Sep 17 00:00:00 2001 From: kapsner Date: Tue, 15 Oct 2024 15:09:00 +0200 Subject: [PATCH] test: updated gha --- .github/workflows/tests.yml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2254443..8158b31 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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: @@ -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: |