-
Notifications
You must be signed in to change notification settings - Fork 5
141 lines (115 loc) Β· 4.83 KB
/
R-CMD-check.yaml
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
139
140
141
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
name: R-CMD-check
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
# vignette rendering is switched off though because of:
# - https://github.com/tidyverse/ggplot2/issues/2252#issuecomment-1006713187
# - https://github.com/lcolladotor/biocthis/issues/27
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v2
- name: Set NOT_CRAN=false on Windows
if: runner.os == 'Windows'
run: |
echo "NOT_CRAN=false" >> $GITHUB_ENV
shell: bash
- name: Install rgdal dependencies (macOS)
if: runner.os == 'macOS'
run: brew install gdal
- name: Install ADMIXTOOLS dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install libopenblas-dev libgsl-dev liblapack-dev
- name: Install ADMIXTOOLS dependencies (macOS)
if: runner.os == 'macOS'
run: brew install openblas gsl lapack bedtools
- name: Compile and install ADMIXTOOLS (Linux + macOS)
if: runner.os != 'Windows'
run: |
# create a single directory for all external software
mkdir -p ~/deps
cd ~/deps
# download and unpack the ADMIXTOOLS source code
curl -LO https://github.com/DReichLab/AdmixTools/archive/v7.0.2.tar.gz
tar xf v7.0.2.tar.gz
cd AdmixTools-7.0.2
# set compiler flags (compilation on macOS was failing unable to find
# openblas library files)
export LDFLAGS="-L/usr/local/opt/openblas/lib"
export CPPFLAGS="-I/usr/local/opt/openblas/include"
# compile ADMIXTOOLS and move binaries under bin/
cd src
make clobber
make LDLIBS="-llapack" all
make install
# download testing data for unit tests
cd ../
curl -LO https://reich.hms.harvard.edu/sites/reich.hms.harvard.edu/files/inline-files/AdmixTools_Example_Data.tar_.gz
tar xf AdmixTools_Example_Data.tar_.gz
# run the Perl script with tests for the compiled binaries
cd examples
# fix unportable Perl shebang
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "1s/.*/\#\!\/usr\/bin\/env perl -w/" mklog
else
sed -i "1s/.*/\#\!\/usr\/bin\/env perl/" mklog
fi
./mklog
cd ../
# we need to do this in bash because of $OSTYPE above
shell: bash
- name: Compile and install SLiM
if: runner.os != 'Windows'
run: |
# download SLiM into a separate directory to avoid CRAN errors
mkdir -p ~/deps
cd ~/deps
# installation instructions copied from the SLiM manual:
wget http://benhaller.com/slim/SLiM.zip
unzip SLiM.zip
cd SLiM
cmake .
make slim
- name: Populate PATH with compiled binaries
if: runner.os != 'Windows'
run: |
export PATH="$HOME/deps/SLiM:$HOME/deps/AdmixTools-7.0.2/bin:$PATH"
echo "PATH=$PATH" >> ~/.Renviron
- name: Setup dedicated Python environment for slendr
if: runner.os != 'Windows'
run: |
mkdir ~/R_LIBS
echo "R_LIBS_USER=~/R_LIBS" >> ~/.Renviron
R -e 'install.packages("reticulate", repos = "http://cran.rstudio.com"); reticulate::install_miniconda()'
R -e 'deps <- c("msprime==1.2.0", "tskit==0.5.5", "pyslim==1.0.3"); PYTHON_ENV <- paste0("Python-3.11_", paste(gsub("==", "-", deps), collapse = "_")); reticulate::conda_create(envname = PYTHON_ENV, python_version = '3.11'); reticulate::use_condaenv(PYTHON_ENV, required = TRUE); reticulate::conda_install(envname = PYTHON_ENV, packages = c(deps, "pandas"), pip = TRUE)'
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck
- uses: r-lib/actions/check-r-package@v2