Skip to content

Commit

Permalink
Merge pull request #909 from maxulysse/cache_test_data
Browse files Browse the repository at this point in the history
Cache test data on GHA
  • Loading branch information
maxulysse authored Jan 12, 2023
2 parents e675387 + 6337c08 commit 9457e12
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,35 @@ jobs:
profile: ["docker", "singularity", "conda"]
env:
NXF_ANSI_LOG: false
TEST_DATA_BASE: "${{ github.workspace }}/test-datasets"
steps:
- name: Check out pipeline code
uses: actions/checkout@v3

- name: Cache test data
id: cache-testdata
uses: actions/cache@v3
with:
path: test-datasets/
key: sarek3-test-data

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

- name: Replace remote paths in samplesheets
run: |
for f in tests/csv/3.0/*csv; do
sed -i "s=https://raw.githubusercontent.com/nf-core/test-datasets/modules/=${{ github.workspace }}/test-datasets/=g" $f
echo "========== $f ============"
cat $f
echo "========================================"
done;
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/pytest-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
matrix:
tags: ["${{ fromJson(needs.changes.outputs.tags) }}"]
profile: ["docker", "singularity", "conda"]
TEST_DATA_BASE:
- "test-datasets/data"
NXF_VER:
- "22.10.1"
- "latest-everything"
Expand All @@ -55,10 +57,35 @@ jobs:
tags: merge
env:
NXF_ANSI_LOG: false
TEST_DATA_BASE: "${{ github.workspace }}/test-datasets"
steps:
- name: Check out pipeline code
uses: actions/checkout@v3

- name: Cache test data
id: cache-testdata
uses: actions/cache@v3
with:
path: test-datasets/
key: sarek3-test-data

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

- name: Replace remote paths in samplesheets
run: |
for f in tests/csv/3.0/*csv; do
sed -i "s=https://raw.githubusercontent.com/nf-core/test-datasets/modules/=${{ github.workspace }}/test-datasets/=g" $f
echo "========== $f ============"
cat $f
echo "========================================"
done;
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ results/
testing/
testing*
*.pyc
test-datasets/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#890](https://github.com/nf-core/sarek/pull/890) - Sync `TEMPLATE` with `tools` `2.7.1`
- [#898](https://github.com/nf-core/sarek/pull/898) - Sync `TEMPLATE` with `tools` `2.7.2`
- [#898](https://github.com/nf-core/sarek/pull/898) - Nextflow minimal version is now `22.10.1`
- [#909](https://github.com/nf-core/sarek/pull/909) - Cache test data on GHA

### Fixed

Expand Down
6 changes: 6 additions & 0 deletions conf/test/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

if (System.getenv('TEST_DATA_BASE')) {
if ("$TEST_DATA_BASE") {
params.test_data_base = "$TEST_DATA_BASE"
}
}

try {
includeConfig "https://raw.githubusercontent.com/nf-core/modules/master/tests/config/test_data.config"
} catch (Exception e) {
Expand Down
3 changes: 1 addition & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,14 @@ params {
show_hidden_params = false
schema_ignore_params = 'genomes,snpeff_version,vep_version,cf_ploidy'


// Config options
custom_config_version = 'master'
custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}"
config_profile_description = null
config_profile_contact = null
config_profile_url = null
config_profile_name = null

test_data_base = 'https://raw.githubusercontent.com/nf-core/test-datasets/sarek3'

// Max resource options
// Defaults only, expecting to be overwritten
Expand Down
7 changes: 7 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,13 @@
"hidden": true,
"fa_icon": "fas fa-users-cog"
},
"test_data_base": {
"type": "string",
"default": "https://raw.githubusercontent.com/nf-core/test-datasets/sarek3",
"description": "Base path / URL for data used in the test profiles",
"help_text": "Warning: The `-profile test` samplesheet file itself contains remote paths. Setting this parameter does not alter the contents of that file.",
"hidden": true
},
"seq_center": {
"type": "string",
"fa_icon": "fas fa-university",
Expand Down

0 comments on commit 9457e12

Please sign in to comment.