diff --git a/docs/tutorials.md b/docs/tutorials.md index 26a66e95..63e99d97 100644 --- a/docs/tutorials.md +++ b/docs/tutorials.md @@ -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. diff --git a/docs/tutorials/github-actions.md b/docs/tutorials/github-actions.md index 6dc90c15..88151ed2 100644 --- a/docs/tutorials/github-actions.md +++ b/docs/tutorials/github-actions.md @@ -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 @@ -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 @@ -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 @@ -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.