From 10881f32ddb6aab1d90826e37e57b581bde6aa66 Mon Sep 17 00:00:00 2001 From: Zewen Kelvin Tuong Date: Tue, 30 Apr 2024 09:29:23 +1000 Subject: [PATCH] fix R --- .github/workflows/tests.yml | 18 +++++++----------- .github/workflows/tests_weekly.yml | 18 +++++++----------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c709d4952..9c4c39709 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -81,6 +81,9 @@ jobs: run: | brew install cairo pkg-config autoconf automake libtool + - name: Set up R + uses: r-lib/actions/setup-r@v2 + - name: Cache conda uses: actions/cache@v3 env: @@ -126,33 +129,26 @@ jobs: - id: R name: Check R version run: | - R --version > VERSION - echo "version=$(head -1 VERSION | awk '{print $3}')" >> $GITHUB_OUTPUT echo "mainbiocversion=$(Rscript -e 'cat(unlist(tools:::.BioC_version_associated_with_R_version()))' | awk '{print $1}')" >> $GITHUB_OUTPUT echo "subbiocversion=$(Rscript -e 'cat(unlist(tools:::.BioC_version_associated_with_R_version()))' | awk '{print $2}')" >> $GITHUB_OUTPUT echo "biocversion=$(Rscript -e 'cat(as.character(tools:::.BioC_version_associated_with_R_version()))' | awk '{print $1}')" >> $GITHUB_OUTPUT shell: bash -l {0} - - name: Set up R - uses: r-lib/actions/setup-r@v2 - with: - r-version: ${{ steps.R.outputs.version}} - - name: Cache ubuntu R packages if: "!contains(github.event.head_commit.message, '/nocache') && matrix.config.os == 'ubuntu-latest'" uses: actions/cache@v3 with: path: /home/runner/work/_temp/Library - key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-r-${{ steps.R.outputs.version}}-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-r-${{ steps.R.outputs.version}}- + key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}- - name: Cache macOS R packages if: "!contains(github.event.head_commit.message, '/nocache') && matrix.config.os != 'ubuntu-latest'" uses: actions/cache@v3 with: path: ${{ env.R_LIBS_USER }} - key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-r-${{ steps.R.outputs.version}}-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-r-${{ steps.R.outputs.version}}- + key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}- - name: Setup r-lib/remotes run: | diff --git a/.github/workflows/tests_weekly.yml b/.github/workflows/tests_weekly.yml index 3e69a0413..e543d72be 100644 --- a/.github/workflows/tests_weekly.yml +++ b/.github/workflows/tests_weekly.yml @@ -57,6 +57,9 @@ jobs: run: | brew install cairo pkg-config autoconf automake libtool + - name: Set up R + uses: r-lib/actions/setup-r@v2 + - name: Cache conda uses: actions/cache@v3 env: @@ -102,33 +105,26 @@ jobs: - id: R name: Check R version run: | - R --version > VERSION - echo "version=$(head -1 VERSION | awk '{print $3}')" >> $GITHUB_OUTPUT echo "mainbiocversion=$(Rscript -e 'cat(unlist(tools:::.BioC_version_associated_with_R_version()))' | awk '{print $1}')" >> $GITHUB_OUTPUT echo "subbiocversion=$(Rscript -e 'cat(unlist(tools:::.BioC_version_associated_with_R_version()))' | awk '{print $2}')" >> $GITHUB_OUTPUT echo "biocversion=$(Rscript -e 'cat(as.character(tools:::.BioC_version_associated_with_R_version()))' | awk '{print $1}')" >> $GITHUB_OUTPUT shell: bash -l {0} - - name: Set up R - uses: r-lib/actions/setup-r@v2 - with: - r-version: ${{ steps.R.outputs.version}} - - name: Cache ubuntu R packages if: "!contains(github.event.head_commit.message, '/nocache') && matrix.config.os == 'ubuntu-latest'" uses: actions/cache@v3 with: path: /home/runner/work/_temp/Library - key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-r-${{ steps.R.outputs.version}}-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-r-${{ steps.R.outputs.version}}- + key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}- - name: Cache macOS R packages if: "!contains(github.event.head_commit.message, '/nocache') && matrix.config.os != 'ubuntu-latest'" uses: actions/cache@v3 with: path: ${{ env.R_LIBS_USER }} - key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-r-${{ steps.R.outputs.version}}-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-r-${{ steps.R.outputs.version}}- + key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-RELEASE_${{ steps.R.outputs.mainbiocversion}}_${{ steps.R.outputs.subbiocversion}}- - name: Setup r-lib/remotes run: |