Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] GitHub Actions test #364

Open
wants to merge 100 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
2b6e86c
Changed library loading location before config
Jan 12, 2022
b87940f
Merge branch 'v1.9rc' into rna-rmd-fixes
daler Jan 16, 2022
b9bcb65
Update rnaseq.Rmd
fridells51 Jan 24, 2022
b934b36
try adding actions config
daler Jan 25, 2022
b100c36
create backup circleci config
daler Jan 25, 2022
b8eeee2
mv circleci dir
daler Jan 25, 2022
49160a1
use mamba, and build r env too
daler Jan 25, 2022
2a6b3d4
remove builds from env-r.yml
daler Sep 19, 2022
3a30e1c
update env-r.yml export
daler Sep 19, 2022
d9be762
remove builds from env.yml
daler Sep 19, 2022
f0ee490
Merge branch 'v1.9rc' into actions
Nov 9, 2022
a1afb65
fully remove phix
Nov 9, 2022
bc33b28
use v1.9 env yml
daler Nov 11, 2022
751250c
Merge branch 'master' into v1.10
daler Nov 11, 2022
43c8a0a
Merge branch 'master' into actions
Nov 12, 2022
1748d99
update conda config; hash on env-r
Nov 12, 2022
9daee34
update cache action to v3
Nov 12, 2022
85b7951
github actions fail fast
Nov 12, 2022
7203120
Merge branch 'v1.10' into rna-rmd-fixes
daler Nov 12, 2022
862c356
Merge pull request #356 from lcdb/rna-rmd-fixes
daler Nov 14, 2022
cd7e6b0
add gres=lscratch to clusterconfig and wrapper_slurm
Nov 19, 2022
1f47824
fix #368
Nov 19, 2022
172c414
fix #367
Nov 19, 2022
98f420a
add .bai to patterns/targets for markduplicates; fix #351
Nov 19, 2022
85be804
fix R tests
Nov 19, 2022
43d8d8e
add test settings to bam coverage args
Nov 19, 2022
ea937ac
initial move to using the lcdb-wf-test script for CI
Nov 19, 2022
5949ab7
Merge branch 'v1.10' of github.com:lcdb/lcdb-wf into v1.10
Nov 19, 2022
0e239d6
fix "kinds" arg
Nov 19, 2022
ab28a1f
start v1.10 changelog
Nov 19, 2022
7d39e80
next round of porting all tests to test/lcdb-wf-test
daler Nov 23, 2022
6f90e67
fix ci config typo
daler Nov 23, 2022
ece7c1a
remove redundant libsizes rules
daler Nov 23, 2022
33f2948
default to correct branch
daler Nov 23, 2022
fd56a35
improve docs and help for testing script
daler Nov 23, 2022
c6765a1
ensure configured env-r is activated before testing lib
daler Nov 23, 2022
0abaa46
improvements to testing config and script
daler Nov 24, 2022
6a5413b
minor tweaks to r tests
daler Nov 24, 2022
b088449
minor test fixes
daler Nov 24, 2022
c1d0137
run set-path on pytest ci job
daler Nov 24, 2022
ab339b3
copy test config for ci
daler Nov 24, 2022
0f774da
typo in ci config
daler Nov 24, 2022
62ed17b
allow --kind all
daler Nov 24, 2022
cd8422e
export $ORIG
daler Nov 24, 2022
03c83df
more test refactoring
daler Nov 25, 2022
7fb9b9b
test infra updates
daler Nov 25, 2022
32a4228
typo
daler Nov 25, 2022
92b7fc0
debug test
daler Nov 25, 2022
8c39c3f
debug test
daler Nov 25, 2022
82e0e96
debug test
daler Nov 25, 2022
3c32959
debug test
daler Nov 25, 2022
ea7558f
debug test
daler Nov 25, 2022
c836e91
debug test
daler Nov 25, 2022
04f01fa
debug test
daler Nov 25, 2022
54bf20e
typo in wrapper_slurm
daler Nov 26, 2022
c457320
remove shell prefix setup
daler Nov 26, 2022
d539abf
add resources to rnaseq rules
daler Nov 26, 2022
1799f0f
rm shell prefix from rnaseq
daler Nov 26, 2022
587a909
Merge branch 'v1.10' of github.com:lcdb/lcdb-wf into v1.10
daler Nov 26, 2022
22a5f69
remove clusterconfig and cluster from WRAPPER_SLURM
esnaultc Feb 22, 2023
e26bde8
use snakemake profile env var if set
esnaultc Feb 23, 2023
46e4226
update chipseq Snakefile for snakemake profile
esnaultc Feb 23, 2023
12935fb
fix input.control in fingerprint
esnaultc Feb 23, 2023
2fcbea5
set --restart-times to 3
esnaultc Feb 24, 2023
f29ae61
autobump mem_mb for fastq_dump
esnaultc Feb 24, 2023
62bf67f
fix volcano plots not showing before barplot
esnaultc Mar 6, 2023
651d4e2
allow skipping orgDb
esnaultc Mar 6, 2023
09e1e2f
use :::
esnaultc Mar 7, 2023
b1c81de
modify gene pattern to be stand-alone Rmd
esnaultc Mar 7, 2023
6b0ceae
add R plotting function for scatterplot of 2 contrasts LFCs color-cod…
esnaultc Mar 10, 2023
ad2b6e0
make lcdb-wf snakemake profile name consistent with snakemake
esnaultc Mar 29, 2023
e72a291
fix fastq-dump autobump
esnaultc Mar 29, 2023
7d2be46
update env requirements to latest compatible versions
esnaultc Mar 30, 2023
f48e7a7
update broken ERCC link
esnaultc Mar 30, 2023
682cf2a
fix salmon version requirements
esnaultc Mar 30, 2023
1c15b7e
update conda upon requirements updates
esnaultc Mar 30, 2023
7071724
fix picard version
esnaultc Mar 30, 2023
d11e54d
debug tests
esnaultc Mar 30, 2023
a13c805
debug tests
esnaultc Mar 30, 2023
9a3d629
debug tests
esnaultc Mar 31, 2023
154904a
debug tests
esnaultc Mar 31, 2023
5069a7d
debug tests
esnaultc Mar 31, 2023
b5e5fb7
debug tests
esnaultc Mar 31, 2023
06c5d9a
debug tests
esnaultc Mar 31, 2023
cd6caf4
debug tests
esnaultc Mar 31, 2023
bc2aaca
debug tests
esnaultc Mar 31, 2023
a93b30a
debug tests
esnaultc Mar 31, 2023
53bb131
trigger rebuilding envs
esnaultc Mar 31, 2023
13d9c2c
debug tests
esnaultc Mar 31, 2023
99663a6
debug tests
esnaultc Mar 31, 2023
9811f88
debug tests
esnaultc Mar 31, 2023
4451209
trigger new cache
esnaultc Mar 31, 2023
34408bb
align save/restore caches
daler Apr 2, 2023
5e483a9
invalidate cache
daler Apr 2, 2023
0e375d4
don't need to install yaml so early
daler Apr 2, 2023
de03bff
set strict channel priority
daler Apr 2, 2023
6452bcc
streamline jobs for tighter feedback loop when troubleshooting
daler Apr 2, 2023
60929db
Merge branch 'v1.10' into actions
daler Apr 2, 2023
5f7dfff
try an actual test with gh actions
daler Apr 2, 2023
8ceaf5a
syntax
daler Apr 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
223 changes: 90 additions & 133 deletions .circleci/config.yml → .circleci.back/config.bak
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ variables:

save_cache: &save_cache
save_cache:
key: v0-{{ checksum "env.yml" }}-{{ checksum "env-r.yml" }}
key: v4-{{ checksum "env.yml" }}-{{ checksum "env-r.yml" }}
paths:
- /opt/conda

Expand All @@ -38,7 +38,7 @@ variables:
restore_cache: &restore_cache
restore_cache:
keys:
- v0-{{ checksum "env.yml" }}-{{ checksum "env-r.yml" }}
- v4-{{ checksum "env.yml" }}-{{ checksum "env-r.yml" }}

# --------------------------------------------------------------------------
# The path needs to be set each time; in jobs below this will be called as
Expand All @@ -48,10 +48,13 @@ variables:
name: Set path
command: |
# x11-utils required to avoid R::png() segfaulting
apt update && apt install -y locales-all locales x11-utils
apt update && apt install -y locales-all locales rsync x11-utils
echo 'export DEPLOY=/tmp/lcdb-wf-test' >> $BASH_ENV
echo 'export LCDBWF_ENV=lcdb-wf-test' >> $BASH_ENV
echo 'export LCDBWF_ENV_R=lcdb-wf-test-r' >> $BASH_ENV
echo 'export LC_ALL=en_US.utf8' >> $BASH_ENV
echo 'export LANG=en_US.utf8' >> $BASH_ENV
echo 'export ORIG=$(pwd)' >> $BASH_ENV
source $BASH_ENV
# --------------------------------------------------------------------------
# Set up conda if the environments do not already exist
Expand All @@ -60,20 +63,21 @@ variables:
name: Setup conda
command: |
set -e
apt update
apt install -y locales-all locales
export LC_ALL=en_US.utf8
export LANG=en_US.utf8
source $BASH_ENV
# We only do the installation if the conda environment does not already
# exist.
if ! conda env list | grep -q "lcdb-wf-test"; then
echo "Setting up conda..."
conda update conda
conda config --system --add channels defaults
conda config --system --add channels bioconda
conda config --system --add channels conda-forge
conda install mamba -y
mamba env create -n lcdb-wf-test --file env.yml
mamba env create -n lcdb-wf-test-r --file env-r.yml
conda config --system --set channel_priority strict
conda install gcc mamba yaml -y
which mamba
mamba --version
mamba env create -n $LCDBWF_ENV --file env.yml
mamba env create -n $LCDBWF_ENV_R --file env-r.yml
fi

# --------------------------------------------------------------------------
Expand All @@ -82,6 +86,7 @@ variables:
run:
name: Download example data
command: |
conda info --envs
source activate lcdb-wf-test

# rsync is required for the deployment process
Expand All @@ -98,14 +103,17 @@ variables:
cp workflows/colocalization/run_test.sh $DEPLOY/workflows/references
cp workflows/colocalization/run_test.sh $DEPLOY/workflows/colocalization
mkdir $DEPLOY/ci
mkdir $DEPLOY/test
cp test/lcdb-wf-test $DEPLOY/test
cp test/workflow_test_params.yaml $DEPLOY/test
cp ci/get-data.py $DEPLOY/ci

# the ./run_test.sh scripts run this
cp ci/preprocessor.py $DEPLOY/ci

# download example data
cd $DEPLOY
python ci/get-data.py
test/lcdb-wf-test data --kind=all --verbose

# --------------------------------------------------------------------------
# Run the doctests across the included modules
Expand All @@ -115,29 +123,22 @@ variables:
command: |
source activate lcdb-wf-test

# Ensure that the chunks in rnaseq.Rmd have matching documentation
(cd ci && python ensure_docs.py)
echo LCDBWF_ENV_R=$LCDBWF_ENV_R
echo LCDBWF_ENV=$LCDBWF_ENV

# run unit tests and doctests for the modules in lib
test/lcdb-wf-test unit_tests --pytest

pytest --doctest-modules lib
# Ensure that the chunks in rnaseq.Rmd have matching documentation
test/lcdb-wf-test unit_tests --ensure-docs

# find all URLs in reference configs and make sure they exist
python -c 'from lib.common import check_all_urls_found; check_all_urls_found()'
test/lcdb-wf-test unit_tests --url-check

source deactivate
source activate lcdb-wf-test-r
Rscript -e "devtools::test('lib/lcdbwf')"
# run R package unit tests using the R env
test/lcdb-wf-test unit_tests --r-test


# --------------------------------------------------------------------------
# Other downstream jobs depend on this so that we can catch trivial errors
# quickly
rnaseq-dryrun: &rnaseq-dryrun
run:
name: dry run
command: |
cd $DEPLOY/workflows/rnaseq
source activate lcdb-wf-test
./run_test.sh --use-conda -n
# --------------------------------------------------------------------------
# Standard chipseq workflow
chipseq-step: &chipseq-step
Expand All @@ -146,8 +147,9 @@ variables:
command: |
cd $DEPLOY/workflows/chipseq
source activate lcdb-wf-test
./run_test.sh --use-conda -j2 -k -p -r
python chipseq_trackhub.py config/config.yaml config/hub_config.yaml
$DEPLOY/test/lcdb-wf-test chipseq --run-workflow --use-conda -j2 -k -p -r
$DEPLOY/test/lcdb-wf-test chipseq --trackhub

# --------------------------------------------------------------------------
# Previous versions had an error where chipseq peaks needed to be defined for
# every caller. This does a (relatively) quick test to only run a single
Expand All @@ -156,7 +158,6 @@ variables:
run:
name: chipseq misc
command: |
ORIG=$(pwd)
cd $DEPLOY/workflows/chipseq
source activate lcdb-wf-test
./run_test.sh --use-conda -j2 -k -p -r \
Expand Down Expand Up @@ -185,32 +186,29 @@ variables:
run:
name: references workflow
command: |
cd $DEPLOY/workflows/references
source activate lcdb-wf-test
./run_test.sh --use-conda -j2 -k -p -r --configfile config/config.yaml
$DEPLOY/test/lcdb-wf-test references --run-workflow --configfile=config/config.yaml -j2 -p -r -k --orig $ORIG

# --------------------------------------------------------------------------
# Standard RNA-seq workflow
rnaseq-step: &rnaseq-step
run:
name: rnaseq workflow
command: |
cd $DEPLOY/workflows/rnaseq
cd $DEPLOY
source activate lcdb-wf-test
./run_test.sh --use-conda -j2 -k -p -r
python rnaseq_trackhub.py config/config.yaml config/hub_config.yaml
$DEPLOY/test/lcdb-wf-test rnaseq --run-workflow -n
$DEPLOY/test/lcdb-wf-test rnaseq --run-workflow --use-conda -j2 -k -p -r --orig $ORIG

# Starting in v1.6, we separate out the non-R from the
# R environments. So we need to test the rnaseq.Rmd separately
# outside the context of the Snakefile.
source activate lcdb-wf-test-r
$DEPLOY/test/lcdb-wf-test rnaseq --trackhub --orig $ORIG

# This script runs the preprocessor on the Rmd files and stores them
# This run the preprocessor on the Rmd files and stores them
# in a new download-test directory (see the comments in the script
# for details)
bash run_downstream_test.sh
$DEPLOY/test/lcdb-wf-test rnaseq --downstream

# bundle up the entire directory to be used as an artifact
tar -zcf downstream.tar.gz downstream-test/
tar -zcf downstream.tar.gz workflows/rnaseq/downstream-test/

# --------------------------------------------------------------------------
# Various tests on RNA-seq workflow that don't warrant the overhead of a new
Expand All @@ -221,63 +219,20 @@ variables:
command: |
ORIG=$(pwd)
cd $DEPLOY
cp -r workflows/rnaseq workflows/rnaseq-misc-test

# make a copy of the data so we can get a fresh copy each time below
cp -r workflows/rnaseq/data /tmp/data
cd workflows/rnaseq-misc-test
source activate lcdb-wf-test

echo "test SRA, PE"
rm -r data
./run_test.sh -j 1 --use-conda -k -p -r --until cutadapt \
--configfile $ORIG/test/test_configs/test_rnaseq_config.yaml \
--config sampletable=$ORIG/test/test_configs/test_sra_sampletable.tsv

echo "test SRA, SE"
rm -r data
./run_test.sh -j 1 --use-conda -k -p -r --until cutadapt \
--configfile $ORIG/test/test_configs/test_rnaseq_config.yaml \
--config sampletable=$ORIG/test/test_configs/test_sra_sampletable_SE_only.tsv

echo "test strandedness, PE"
rm -r data && cp -r /tmp/data data
./run_test.sh -j 2 --use-conda -k -p -r --until strand_check \
--configfile $ORIG/test/test_configs/test_rnaseq_config.yaml \
--config sampletable=$ORIG/test/test_configs/test_pe_sampletable.tsv

echo "test strandedness, SE"
rm -r data && cp -r /tmp/data data
./run_test.sh -j 2 --use-conda -k -p -r --until strand_check \
--configfile $ORIG/test/test_configs/test_rnaseq_config.yaml \
--config sampletable=$ORIG/test/test_configs/two_samples.tsv

echo "test STAR 2-pass alignment"
rm -r data && cp -r /tmp/data data
./run_test.sh -j 2 --use-conda -k -p -r \
--forcerun star_pass1 \
--configfile \
$ORIG/test/test_configs/test_rnaseq_config.yaml \
$ORIG/test/test_configs/star_override_2pass.yaml \
--config sampletable=$ORIG/test/test_configs/two_samples.tsv \
--until star_pass2

echo "test STAR 1-pass alignment"
rm -r data && cp -r /tmp/data data
./run_test.sh -j 2 --use-conda -k -p -r \
--forcerun star \
--configfile \
$ORIG/test/test_configs/test_rnaseq_config.yaml \
$ORIG/test/test_configs/star_override_1pass.yaml \
--config sampletable=$ORIG/test/test_configs/two_samples.tsv \
--until star

echo "test PE reads"
rm -r data && cp -r /tmp/data data
./run_test.sh -j 2 --use-conda -k -p -r --until multiqc \
--configfile \
$ORIG/test/test_configs/test_rnaseq_config.yaml \
--config sampletable=$ORIG/test/test_configs/test_pe_sampletable.tsv
# Check the help for test/lcdb-wf-test to see what args these
# provide; some of them use the --until argument to restrict the
# rules that are run. Note the use of --orig $ORIG to use the test
# configs from the original clone rather than the deployed directory.
$DEPLOY/test/lcdb-wf-test rnaseq --run-workflow --sra-pe -k -r -p -j2 --use-conda --orig $ORIG
$DEPLOY/test/lcdb-wf-test rnaseq --run-workflow --sra-se -k -r -p -j2 --use-conda --orig $ORIG
$DEPLOY/test/lcdb-wf-test rnaseq --run-workflow --strandedness-pe -k -r -p -j2 --use-conda --orig $ORIG
$DEPLOY/test/lcdb-wf-test rnaseq --run-workflow --star-2pass -k -r -p -j2 --use-conda --orig $ORIG
$DEPLOY/test/lcdb-wf-test rnaseq --run-workflow --star-1pass -k -r -p -j2 --use-conda --orig $ORIG
$DEPLOY/test/lcdb-wf-test rnaseq --run-workflow --pe -k -r -p -j2 --use-conda --orig $ORIG



# --------------------------------------------------------------------------
# Standard colocalization workflow
Expand Down Expand Up @@ -307,6 +262,7 @@ jobs:
<<: *defaults
steps:
- checkout
- *set-path

# Check the hashes of requirements files. If they match a cache, load it.
# The cache is set up to be the entire miniconda installation, so that
Expand Down Expand Up @@ -337,6 +293,7 @@ jobs:
steps:
- checkout
- *restore_cache
- *set-path
- *setup
- *pytest-step

Expand Down Expand Up @@ -449,41 +406,41 @@ workflows:
test-suite:
jobs:
- initial-setup
- pytest:
requires:
- initial-setup
- chipseq:
requires:
- initial-setup
- pytest
# - pytest:
# requires:
# - initial-setup
# - chipseq:
# requires:
# - initial-setup
# - pytest
- chipseq-misc:
requires:
- initial-setup
- pytest
- rnaseq:
requires:
- initial-setup
- pytest
- rnaseq-misc:
requires:
- initial-setup
- pytest
- references:
requires:
- initial-setup
- pytest
- colocalization:
requires:
- initial-setup
- pytest
- build-docs:
requires:
- initial-setup
- report-env:
requires:
- rnaseq
- rnaseq-misc
- chipseq
- chipseq-misc
- references
- colocalization
# - pytest
# - rnaseq:
# requires:
# - initial-setup
# - pytest
# - rnaseq-misc:
# requires:
# - initial-setup
# - pytest
# - references:
# requires:
# - initial-setup
# - pytest
# - colocalization:
# requires:
# - initial-setup
# - pytest
# - build-docs:
# requires:
# - initial-setup
# - report-env:
# requires:
# - rnaseq
# - rnaseq-misc
# - chipseq
# - chipseq-misc
# - references
# - colocalization
Loading