Skip to content

Commit

Permalink
Update tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
lukfor committed May 23, 2024
1 parent a047509 commit 44a9fb1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

---

### :material-file:{ style="color: #337ab7" } Setup nf-test on GitHub Actions
### [:material-file:{ style="color: #337ab7" } Setup nf-test on GitHub Actions](tutorials/github-actions.md)

In this tutorial, we will guide you through setting up and running `nf-test` on GitHub Actions.

Expand Down
29 changes: 26 additions & 3 deletions docs/tutorials/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v2
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
shard: [1, 2, 3, 4]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v2
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
shard: [1, 2, 3, 4]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down Expand Up @@ -145,6 +145,29 @@ jobs:
1. **Checkout with Full History**: The `actions/checkout@v2` action is updated with `fetch-depth: 0` to fetch the full history of the repository. This is necessary for accurately determining the changes since the last commit.
2. **Run Tests with Changed Files**: The `run` command is further updated to include the `--changed-since HEAD^` option. This option ensures that only the tests affected by the changes since the previous commit are run.


## Step 4: Adapting nf-test.config to Trigger Full Test Runs

In some cases, changes to specific critical files should trigger a full test run, regardless of other changes. To configure this, you need to adapt your `nf-test.config` file.

Add the following lines to your `nf-test.config`:

```groovy
config {
...
triggers 'nextflow.config', 'nf-test.config', 'test-data/**/*'
...
}
```

The `triggers` directive in `nf-test.config` specifies a list of filenames or patterns that should trigger a full test run. For example:

- `'nextflow.config'`: Changes to the main Nextflow configuration file will trigger a full test run.
- `'nf-test.config'`: Changes to the nf-test configuration file itself will trigger a full test run.
- `'test-data/**/*'`: Changes to any files within the `test-data` directory will trigger a full test run.

This configuration ensures that critical changes always result in a comprehensive validation of the pipeline, providing additional confidence in your CI process.

## Summary

1. **Without Sharding**: A straightforward setup where all tests run in a single job.
Expand Down

0 comments on commit 44a9fb1

Please sign in to comment.