Skip to content

Create .gitattributes #42

Create .gitattributes

Create .gitattributes #42

Workflow file for this run

# 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 }} (R-${{ matrix.config.r }}), ADMIXTOOLS v${{ matrix.admixtools }}
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', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
admixtools: ["7.0.2", "6.0", "5.1"]
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v2
- name: Install ADMIXTOOLS/admixr dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install libopenblas-dev libgsl-dev liblapack-dev bedtools
- name: Install ADMIXTOOLS/admixr 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/v${{ matrix.admixtools }}.tar.gz
tar xf v${{ matrix.admixtools }}.tar.gz
cd AdmixTools-${{ matrix.admixtools }}
# 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
# for some reason, mergeit isn't built in 6.x and 5.x?
# compile it and copy it
make mergeit
cp mergeit ../bin
# 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: Populate PATH with compiled binaries
if: runner.os != 'Windows'
run: |
export PATH="$HOME/deps/AdmixTools-${{ matrix.admixtools }}/bin:$PATH"
echo "PATH=$PATH" > ~/.Renviron
- 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