forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (120 loc) · 5.98 KB
/
r-daily.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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