Skip to content

Commit

Permalink
Implement caching of test data in github action
Browse files Browse the repository at this point in the history
  • Loading branch information
nictru committed Sep 26, 2023
1 parent 5e3e123 commit 8db8423
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,35 @@ jobs:
with:
version: "${{ matrix.NXF_VER }}"

- name: Hash Github Workspace
id: hash_workspace
run: |
echo "digest=$(echo RNA_3.10.1_${{ github.workspace }} | md5sum | cut -c 1-25)" >> $GITHUB_OUTPUT
- name: Cache test data
id: cache-testdata
uses: actions/cache@v3
with:
path: test-datasets/
key: ${{ steps.hash_workspace.outputs.digest }}

- name: Check out test data
if: steps.cache-testdata.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: nf-core/test-datasets
ref: circrna
path: test-datasets/

- name: Replace remote paths in samplesheets
run: |
for f in ${{ github.workspace }}/test-datasets/*.csv; do
sed -i "s=https://raw.githubusercontent.com/nf-core/test-datasets/circrna/=${{ github.workspace }}/test-datasets/=g" $f
echo "========== $f ============"
cat $f
echo "========================================"
done;
- name: Run pipeline with test data
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results
nextflow run ${GITHUB_WORKSPACE} -profile test_cache,docker --outdir ./results --test_data_base ${{ github.workspace }}/test-datasets
34 changes: 34 additions & 0 deletions conf/test_cache.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nextflow config file for running minimal tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines input files and everything required to run a fast and simple pipeline test.
Use as follows:
nextflow run nf-core/circrna -profile test,<docker/singularity> --outdir <OUTDIR>
----------------------------------------------------------------------------------------
*/

params {
config_profile_name = 'Test profile'
config_profile_description = 'Minimal test dataset to check pipeline function'

// Limit resources so that this can run on GitHub Actions
max_cpus = 2
max_memory = 6.GB
max_time = 6.h

// Input data for test data
input = "${params.test_data_base}/samples.csv"
fasta = "${params.test_data_base}/reference/chrI.fa"
gtf = "${params.test_data_base}/reference/chrI.gtf"
mature = "${params.test_data_base}/reference/mature.fa"
tool = "circexplorer2"
phenotype = "${params.test_data_base}/phenotype.csv"
skip_trimming = false
module = "circrna_discovery,mirna_prediction,differential_expression"
outdir = "results/"
bsj_reads = 2
species = "cel"
}

0 comments on commit 8db8423

Please sign in to comment.