Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: ["github>nf-core/ops//.github/renovate/default.json5"],
baseBranchPatterns: ["master"],
}
82 changes: 82 additions & 0 deletions .github/workflows/fix-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Fix linting from a comment
on:
issue_comment:
types: [created]

jobs:
fix-linting:
# Only run if comment is on a PR with the main repo, and if it contains the magic keywords
if: >
contains(github.event.comment.html_url, '/pull/') &&
contains(github.event.comment.body, '@nf-core-bot fix linting') &&
github.repository == 'nf-core/test-datasets'
runs-on: ubuntu-latest
steps:
# Use the @nf-core-bot token to check out so we can push later
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
with:
token: ${{ secrets.nf_core_bot_auth_token }}

# indication that the linting is being fixed
- name: React on comment
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
with:
comment-id: ${{ github.event.comment.id }}
reactions: eyes

# Action runs on the issue comment, so we don't get the PR by default
# Use the gh cli to check out the PR
- name: Checkout Pull Request
run: gh pr checkout ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }}

# Install and run prek
- name: Run prek
id: prek
uses: j178/prek-action@91fd7d7cf70ae1dee9f4f44e7dfa5d1073fe6623 # v1
continue-on-error: true

# indication that the linting has finished
- name: react if linting finished succesfully
if: steps.prek.outcome == 'success'
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
with:
comment-id: ${{ github.event.comment.id }}
reactions: "+1"

- name: Commit & push changes
id: commit-and-push
if: steps.prek.outcome == 'failure'
run: |
git config user.email "core@nf-co.re"
git config user.name "nf-core-bot"
git config push.default upstream
git add .
git status
git commit -m "[automated] Fix code linting"
git push

- name: react if linting errors were fixed
id: react-if-fixed
if: steps.commit-and-push.outcome == 'success'
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
with:
comment-id: ${{ github.event.comment.id }}
reactions: hooray

- name: react if linting errors were not fixed
if: steps.commit-and-push.outcome == 'failure'
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
with:
comment-id: ${{ github.event.comment.id }}
reactions: confused

- name: react if linting errors were not fixed
if: steps.commit-and-push.outcome == 'failure'
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
with:
issue-number: ${{ github.event.issue.number }}
body: |
@${{ github.actor }} I tried to fix the linting errors, but it didn't work. Please fix them manually.
See [CI log](https://github.com/nf-core/test-datasets/actions/runs/${{ github.run_id }}) for more details.
20 changes: 20 additions & 0 deletions .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Run pre-commit hooks
on:
push:
branches:
- "**" # runs on all branches

# Cancel if a newer run is started
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
pre-commit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6

- name: Run prek
uses: j178/prek-action@91fd7d7cf70ae1dee9f4f44e7dfa5d1073fe6623 # v1
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
additional_dependencies:
- prettier@3.7.1
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
args:
- --markdown-linebreak-ext=md
- id: end-of-file-fixer
- repo: local
hooks:
- id: prevent-file-deletion
name: Prevent file deletions
language: system
entry: bash -c 'git diff --cached --name-only --diff-filter=D | grep -q . && echo "❌ File deletions are not allowed. Ask on slack for exceptions" && exit 1 || exit 0'
pass_filenames: false
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ![nfcore/test-datasets](docs/images/test-datasets_logo.png)

Test data to be used for automated testing with the nf-core pipelines

> ⚠️ **Do not merge your test data to `master`! Each pipeline has a dedicated branch (and a special one for modules)**
Expand All @@ -13,8 +14,8 @@ The principle for nf-core test data is as small as possible, as large as necessa

nf-core/test-datasets comes with documentation in the `docs/` directory:

01. [Add a new test dataset](https://github.com/nf-core/test-datasets/blob/master/docs/ADD_NEW_DATA.md)
02. [Use an existing test dataset](https://github.com/nf-core/test-datasets/blob/master/docs/USE_EXISTING_DATA.md)
1. [Add a new test dataset](https://github.com/nf-core/test-datasets/blob/master/docs/ADD_NEW_DATA.md)
2. [Use an existing test dataset](https://github.com/nf-core/test-datasets/blob/master/docs/USE_EXISTING_DATA.md)

## Downloading test data

Expand Down
20 changes: 10 additions & 10 deletions docs/ADD_NEW_DATA.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

Please fill in the appropriate checklist below (delete whatever is not relevant). These are the most common things requested when adding a new test dataset.

- [ ] Check [here](https://github.com/nf-core/test-datasets/branches/all) that there isn't already a branch containing data that could be used
- If this is the case, follow the [documentation on how to use an existing test dataset](https://github.com/nf-core/test-datasets/blob/master/docs/USE_EXISTING_DATA.md)
- [ ] Fork the [nf-core/test-datasets repository](https://github.com/nf-core/test-datasets) to your GitHub account
- [ ] Create a new branch on your fork
- [ ] Check your proposed test data follows the [guidelines](https://nf-co.re/docs/contributing/test_data_guidelines)
- [ ] Add your test dataset
- [ ] If you clone it locally use `git clone <url> --branch <branch> --single-branch`
- [ ] Make a PR on a new branch with a relevant name
- [ ] Wait for the PR to be merged
- [ ] Use this newly created branch for your tests
- [ ] Check [here](https://github.com/nf-core/test-datasets/branches/all) that there isn't already a branch containing data that could be used
- If this is the case, follow the [documentation on how to use an existing test dataset](https://github.com/nf-core/test-datasets/blob/master/docs/USE_EXISTING_DATA.md)
- [ ] Fork the [nf-core/test-datasets repository](https://github.com/nf-core/test-datasets) to your GitHub account
- [ ] Create a new branch on your fork
- [ ] Check your proposed test data follows the [guidelines](https://nf-co.re/docs/contributing/test_data_guidelines)
- [ ] Add your test dataset
- [ ] If you clone it locally use `git clone <url> --branch <branch> --single-branch`
- [ ] Make a PR on a new branch with a relevant name
- [ ] Wait for the PR to be merged
- [ ] Use this newly created branch for your tests
14 changes: 7 additions & 7 deletions docs/USE_EXISTING_DATA.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

Please fill in the appropriate checklist below (delete whatever is not relevant). These are the most common things requested when adding a new test dataset.

- [ ] Check [here](https://github.com/nf-core/test-datasets/branches/all) to find the branch corresponding to the test dataset you want to use (i.e., `modules`, or a given pipeline)
- [ ] Alternatively use nf-core tools to search and explore, e.g. `nf-core test-datasets list` (press tab for options), and then `nf-core test-datasets search -b modules fasta` (press tab for options)
- [ ] You can also use the flag `--generate-nf-path` to generate config ready strings
- [ ] Specify in the `conf/test.config` the path to the files from the test dataset
- [ ] Set up your CI tests following the nf-core best practices
- [ ] For pipelines: [tests/default.nf.test](https://github.com/nf-core/tools/blob/main/nf_core/pipeline-template/tests/default.nf.test))
- [ ] For modules: [tests/main.nf.test](https://github.com/nf-core/tools/blob/main/nf_core/module-template/tests/main.nf.test.j2)
- [ ] Check [here](https://github.com/nf-core/test-datasets/branches/all) to find the branch corresponding to the test dataset you want to use (i.e., `modules`, or a given pipeline)
- [ ] Alternatively use nf-core tools to search and explore, e.g. `nf-core test-datasets list` (press tab for options), and then `nf-core test-datasets search -b modules fasta` (press tab for options)
- [ ] You can also use the flag `--generate-nf-path` to generate config ready strings
- [ ] Specify in the `conf/test.config` the path to the files from the test dataset
- [ ] Set up your CI tests following the nf-core best practices
- [ ] For pipelines: [tests/default.nf.test](https://github.com/nf-core/tools/blob/main/nf_core/pipeline-template/tests/default.nf.test))
- [ ] For modules: [tests/main.nf.test](https://github.com/nf-core/tools/blob/main/nf_core/module-template/tests/main.nf.test.j2)
2 changes: 1 addition & 1 deletion docs/images/test-datasets_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions example_samplesheet.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ID,spectrum_file
1,/yourDirectory/sample1.d
2,/yourDirectory/sample2.tar.gz
3,/yourDirectory/sample3.zip
4,/yourDirectory/sample4.raw
5,/yourDirectory/sample5.raw.gz
6,/yourDirectory/sample6.raw.tar.gz
7,/yourDirectory/sample7.raw.zip
8,/yourDirectory/sample8.raw