Skip to content

Update r-daily.yml #220

Update r-daily.yml

Update r-daily.yml #220

Workflow file for this run

name: r-daily
on:
push:
branches:
- r-daily-source
jobs:
r-daily-update:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.MY_PAT }}
GITHUB_TOKEN: ${{ secrets.MY_PAT }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
#fetch-depth: 0
token: ${{ secrets.MY_PAT }}
- name: Configure git
run: |
git config --global user.name "Bruno Rodrigues"
git config --global user.email "bruno@brodrigues.co"
- name: Synching fork
run: |
git remote add upstream https://github.com/NixOS/nixpkgs
git checkout r-daily-source
git fetch upstream
git reset --hard upstream/master
- name: Change Bioconductor mirror
run: sed -i 's|http://bioconductor\.statistik\.tu-dortmund\.de/packages/|http://bioconductor.org/packages/|g' pkgs/development/r-modules/generate-r-packages.R
# - name: Remove escapeName
# run: sed -i 's|escapeName(name)|name|g' pkgs/development/r-modules/generate-r-packages.R
- name: Update R
run: |
sed -i 's|version = "4.3.3"|version = "4.4.0"|g' pkgs/applications/science/math/R/default.nix
sed -i 's|sha256 = "sha256-gIUSMTk7hb84d+6eObKC51Dthkxexgy9aObhOfBSAzA="|sha256 = "sha256-rOQSX5uXbSxTvMX8owx14w1O3EAVhIWcutsIDnK18DA="|g' pkgs/applications/science/math/R/default.nix
- name: Fix for rJava
run: sed -i 's|rJava = with pkgs; \[ zlib bzip2\.dev icu xz\.dev pcre\.dev jdk libzip \];|rJava = with pkgs; \[ zlib bzip2\.dev icu xz\.dev pcre\.dev jdk libzip libdeflate \];|g' pkgs/development/r-modules/default.nix
- name: Fix for S4Vectors (https://github.com/Bioconductor/S4Vectors/commit/31853e4e97ff6bc3a8a2e0fdcc6dde72fb61c045) and sf, terra, vapour
run: |
sed -i '/flowClust = old/a \
S4Vectors = old.S4Vectors.overrideAttrs (attrs: {\
hardeningDisable = [ "format" ];\
});\
S4Arrays = old.S4Arrays.overrideAttrs (attrs: {\
hardeningDisable = [ "format" ];\
});\
XVector = old.XVector.overrideAttrs (attrs: {\
hardeningDisable = [ "format" ];\
});\
SparseArray = old.SparseArray.overrideAttrs (attrs: {\
hardeningDisable = [ "format" ];\
});\
Rsamtools = old.Rsamtools.overrideAttrs (attrs: {\
hardeningDisable = [ "format" ];\
});\
rtracklayer = old.rtracklayer.overrideAttrs (attrs: {\
hardeningDisable = [ "format" ];\
});\
VariantAnnotation = old.VariantAnnotation.overrideAttrs (attrs: {\
hardeningDisable = [ "format" ];\
});\
terra = old.terra.overrideAttrs (attrs: {\
configureFlags = [\
"--with-proj-lib=${pkgs.lib.getLib pkgs.proj}/lib"\
];\
});\
sf = old.sf.overrideAttrs (attrs: {\
configureFlags = [\
"--with-proj-lib=${pkgs.lib.getLib pkgs.proj}/lib"\
];\
});\
vapour = old.vapour.overrideAttrs (attrs: {\
configureFlags = [\
"--with-proj-lib=${pkgs.lib.getLib pkgs.proj}/lib"\
];\
});\
' pkgs/development/r-modules/default.nix
- name: Updating files
run: |
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily-source/.github/workflows/update-cachix.yml -P .github/workflows/
# start with environments
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/r-daily.nix
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/cachix.nix
# get updated files from r-daily branch
cd pkgs/development/r-modules/
rm *-packages.nix
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/pkgs/development/r-modules/cran-packages.nix
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/pkgs/development/r-modules/bioc-packages.nix
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/pkgs/development/r-modules/bioc-annotation-packages.nix
wget https://raw.githubusercontent.com/rstats-on-nix/nixpkgs/r-daily/pkgs/development/r-modules/bioc-experiment-packages.nix
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
logger: pretty
log-directives: nix_installer=trace
backtrace: full
- name: Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build development environment
run: |
nix-build r-daily.nix
- name: Update R packages
run: |
nix-shell r-daily.nix --run "cd pkgs/development/r-modules/ && Rscript generate-r-packages.R cran > cran-packages.nix.new"
nix-shell r-daily.nix --run "cd pkgs/development/r-modules/ && Rscript generate-r-packages.R bioc > bioc-packages.nix.new"
nix-shell r-daily.nix --run "cd pkgs/development/r-modules/ && Rscript generate-r-packages.R 'bioc-annotation' > bioc-annotation-packages.nix.new"
nix-shell r-daily.nix --run "cd pkgs/development/r-modules/ && Rscript generate-r-packages.R 'bioc-experiment' > bioc-experiment-packages.nix.new"
- name: Rename files
run: |
cd pkgs/development/r-modules/
mv cran-packages.nix.new cran-packages.nix
mv bioc-packages.nix.new bioc-packages.nix
mv bioc-annotation-packages.nix.new bioc-annotation-packages.nix
mv bioc-experiment-packages.nix.new bioc-experiment-packages.nix
- name: Pushing updates
run: |
git checkout -b r-daily
git add .
git commit -m "daily update" || echo "no updated R packages in this period"
git push --force origin r-daily