Skip to content

snakemake-run

snakemake-run #356

on:
push:
pull_request:
branches:
- master
schedule:
- cron: '0 9 * * 5'
name: snakemake-run
jobs:
snakemake-run:
defaults:
run:
shell: bash -l {0}
name: run snakemake
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-12, ubuntu-latest]
include:
- os: macos-12
rversion: '4.4'
- os: ubuntu-latest
rversion: '4.4'
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Install R (macOS)
uses: r-lib/actions/setup-r@v2
if: runner.os == 'macOS'
with:
r-version: ${{ matrix.rversion }}
- name: Check where R is installed
if: runner.os == 'macOS'
run: |
which R
Rscript -e 'print(.libPaths())'
- name: Set up workflow R for macOS
if: runner.os == 'macOS'
run: |
sed -i .bak 's/useCondaR: True/useCondaR: False/' config.yaml
mkdir -p $HOME/Rlib
echo "R_LIBS_USER=${HOME}/Rlib" > .Renviron
cat .Renviron
Rscript -e "install.packages('BiocManager'); BiocManager::install('GenomeInfoDbData')"
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: bioconda,conda-forge,defaults
auto-activate-base: true
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable --yes
sudo apt-get --yes --force-yes update -qq && \
sudo apt-get -y install libcairo2-dev libv8-dev \
libgdal-dev libgeos-dev libgeos++-dev libproj-dev libudunits2-dev \
libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libglpk-dev \
libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev libgit2-dev \
libxml2-dev libuv1 libuv1-dev
- name: Prepare for running workflow
env:
BIOCONDUCTOR_USE_CONTAINER_REPOSITORY: true
run: |
mkdir -p $HOME/.R
echo -e 'MAKEFLAGS = -j8' > $HOME/.R/Makevars
echo 'options(Ncpus = 8)' > $HOME/.Rprofile
echo 'Sys.setenv(BIOCONDUCTOR_USE_CONTAINER_REPOSITORY=TRUE)' >> $HOME/.Rprofile
- name: Install Snakemake
run: |
conda create -c conda-forge -c bioconda -n snakemake snakemake mamba
- name: Run Snakemake
env:
BIOCONDUCTOR_USE_CONTAINER_REPOSITORY: true
run: |
conda activate snakemake
snakemake --use-conda --cores 4
- name: Upload artifact
uses: actions/upload-artifact@v4
if: failure()
with:
name: all_rout
path: example_data/output/Rout/*.Rout