|
11 | 11 | - master |
12 | 12 | - dev |
13 | 13 |
|
| 14 | +env: |
| 15 | + NXF_ANSI_LOG: false |
| 16 | + NFTEST_VER: "0.8.1" |
| 17 | + |
14 | 18 | # Cancel if a newer run is started |
15 | 19 | concurrency: |
16 | 20 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
17 | 21 | cancel-in-progress: true |
18 | 22 |
|
19 | 23 | jobs: |
20 | | - changes: |
21 | | - name: Check for changes |
| 24 | + pytest-changes: |
| 25 | + name: Check for changes (pytest) |
22 | 26 | runs-on: ubuntu-latest |
23 | 27 | outputs: |
24 | 28 | # Expose matched filters as job 'tags' output variable |
25 | 29 | tags: ${{ steps.filter.outputs.changes }} |
26 | 30 | steps: |
27 | 31 | - uses: actions/checkout@v3 |
28 | | - - uses: dorny/paths-filter@v2 |
| 32 | + |
| 33 | + - uses: frouioui/paths-filter@main |
29 | 34 | id: filter |
30 | 35 | with: |
31 | 36 | filters: "tests/config/tags.yml" |
| 37 | + token: "" |
32 | 38 |
|
33 | | - test: |
| 39 | + pytest: |
34 | 40 | name: ${{ matrix.tags }} ${{ matrix.profile }} NF ${{ matrix.NXF_VER }} |
35 | 41 | runs-on: ubuntu-latest |
36 | | - needs: changes |
37 | | - if: needs.changes.outputs.tags != '[]' |
| 42 | + needs: pytest-changes |
| 43 | + if: needs.pytest-changes.outputs.tags != '[]' |
38 | 44 | strategy: |
39 | 45 | fail-fast: false |
40 | 46 | matrix: |
41 | | - tags: ["${{ fromJson(needs.changes.outputs.tags) }}"] |
| 47 | + tags: ["${{ fromJson(needs.pytest-changes.outputs.tags) }}"] |
42 | 48 | profile: ["docker"] |
43 | 49 | # profile: ["docker", "singularity", "conda"] |
44 | 50 | TEST_DATA_BASE: |
|
50 | 56 | NXF_ANSI_LOG: false |
51 | 57 | TEST_DATA_BASE: "${{ github.workspace }}/test-datasets" |
52 | 58 | SENTIEON_LICENSE_BASE64: ${{ secrets.SENTIEON_LICENSE_BASE64 }} |
| 59 | + |
53 | 60 | steps: |
54 | 61 | - name: Check out pipeline code |
55 | 62 | uses: actions/checkout@v3 |
@@ -154,10 +161,126 @@ jobs: |
154 | 161 | !/home/runner/pytest_workflow_*/*/work/conda |
155 | 162 | !/home/runner/pytest_workflow_*/*/work/singularity |
156 | 163 |
|
| 164 | + nftest-changes: |
| 165 | + name: Check for changes (nf-test) |
| 166 | + runs-on: ubuntu-latest |
| 167 | + outputs: |
| 168 | + tags: ${{ steps.filter.outputs.changes }} |
| 169 | + |
| 170 | + steps: |
| 171 | + - uses: actions/checkout@v3 |
| 172 | + |
| 173 | + - name: Combine all tags.yml files |
| 174 | + id: get_tags |
| 175 | + run: find . -name "tags.yml" -not -path "./.github/*" -exec cat {} + > .github/tags.yml |
| 176 | + |
| 177 | + - name: debug |
| 178 | + run: cat .github/tags.yml |
| 179 | + |
| 180 | + - uses: frouioui/paths-filter@main |
| 181 | + id: filter |
| 182 | + with: |
| 183 | + filters: ".github/tags.yml" |
| 184 | + token: "" |
| 185 | + |
| 186 | + nftest: |
| 187 | + name: ${{ matrix.tags }} ${{ matrix.profile }} NF ${{ matrix.NXF_VER }} |
| 188 | + runs-on: ubuntu-latest |
| 189 | + needs: nftest-changes |
| 190 | + if: needs.nftest-changes.outputs.tags != '[]' |
| 191 | + strategy: |
| 192 | + fail-fast: false |
| 193 | + matrix: |
| 194 | + tags: ["${{ fromJson(needs.nftest-changes.outputs.tags) }}"] |
| 195 | + profile: ["docker"] |
| 196 | + # profile: ["docker", "singularity", "conda"] |
| 197 | + TEST_DATA_BASE: |
| 198 | + - "test-datasets/data" |
| 199 | + NXF_VER: |
| 200 | + - "23.04.0" |
| 201 | + - "latest-everything" |
| 202 | + env: |
| 203 | + NXF_ANSI_LOG: false |
| 204 | + TEST_DATA_BASE: "${{ github.workspace }}/test-datasets" |
| 205 | + SENTIEON_LICENSE_BASE64: ${{ secrets.SENTIEON_LICENSE_BASE64 }} |
| 206 | + |
| 207 | + steps: |
| 208 | + - uses: actions/checkout@v3 |
| 209 | + |
| 210 | + - uses: actions/setup-java@v3 |
| 211 | + with: |
| 212 | + distribution: "temurin" |
| 213 | + java-version: "17" |
| 214 | + - name: Setup Nextflow |
| 215 | + uses: nf-core/setup-nextflow@v1 |
| 216 | + |
| 217 | + - name: Cache nf-test installation |
| 218 | + id: cache-software |
| 219 | + uses: actions/cache@v3 |
| 220 | + with: |
| 221 | + path: | |
| 222 | + /usr/local/bin/nf-test |
| 223 | + /home/runner/.nf-test/nf-test.jar |
| 224 | + key: ${{ runner.os }}-${{ env.NFTEST_VER }}-nftest |
| 225 | + |
| 226 | + - name: Install nf-test |
| 227 | + if: steps.cache-software.outputs.cache-hit != 'true' |
| 228 | + run: | |
| 229 | + wget -qO- https://code.askimed.com/install/nf-test | bash |
| 230 | + sudo mv nf-test /usr/local/bin/ |
| 231 | +
|
| 232 | + - name: Setup apptainer |
| 233 | + if: matrix.profile == 'singularity' |
| 234 | + uses: eWaterCycle/setup-apptainer@main |
| 235 | + |
| 236 | + - name: Set up Singularity |
| 237 | + if: matrix.profile == 'singularity' |
| 238 | + run: | |
| 239 | + mkdir -p $NXF_SINGULARITY_CACHEDIR |
| 240 | + mkdir -p $NXF_SINGULARITY_LIBRARYDIR |
| 241 | +
|
| 242 | + - name: Set up miniconda |
| 243 | + uses: conda-incubator/setup-miniconda@v2 |
| 244 | + with: |
| 245 | + miniconda-version: "latest" |
| 246 | + auto-update-conda: true |
| 247 | + channels: conda-forge,bioconda,defaults |
| 248 | + python-version: ${{ matrix.python-version }} |
| 249 | + |
| 250 | + - name: Conda setup |
| 251 | + run: | |
| 252 | + conda clean -a |
| 253 | + conda install -n base conda-libmamba-solver |
| 254 | + conda config --set solver libmamba |
| 255 | + echo $(realpath $CONDA)/condabin >> $GITHUB_PATH |
| 256 | + echo $(realpath python) >> $GITHUB_PATH |
| 257 | +
|
| 258 | + # Set up secrets |
| 259 | + - name: Set up nextflow secrets |
| 260 | + if: env.SENTIEON_LICENSE_BASE64 != null |
| 261 | + run: | |
| 262 | + nextflow secrets set SENTIEON_LICENSE_BASE64 ${{ secrets.SENTIEON_LICENSE_BASE64 }} |
| 263 | + nextflow secrets set SENTIEON_AUTH_MECH_BASE64 ${{ secrets.SENTIEON_AUTH_MECH_BASE64 }} |
| 264 | + SENTIEON_ENCRYPTION_KEY=$(echo -n "${{ secrets.ENCRYPTION_KEY_BASE64 }}" | base64 -d) |
| 265 | + SENTIEON_LICENSE_MESSAGE=$(echo -n "${{ secrets.LICENSE_MESSAGE_BASE64 }}" | base64 -d) |
| 266 | + SENTIEON_AUTH_DATA=$(python3 tests/modules/nf-core/sentieon/license_message.py encrypt --key "$SENTIEON_ENCRYPTION_KEY" --message "$SENTIEON_LICENSE_MESSAGE") |
| 267 | + SENTIEON_AUTH_DATA_BASE64=$(echo -n "$SENTIEON_AUTH_DATA" | base64 -w 0) |
| 268 | + nextflow secrets set SENTIEON_AUTH_DATA_BASE64 $SENTIEON_AUTH_DATA_BASE64 |
| 269 | +
|
| 270 | + # Test the module |
| 271 | + - name: Run nf-test |
| 272 | + run: | |
| 273 | + nf-test test \ |
| 274 | + --profile=${{ matrix.profile }} \ |
| 275 | + --tag ${{ matrix.tags }} \ |
| 276 | + --tap=test.tap \ |
| 277 | + --verbose |
| 278 | +
|
157 | 279 | confirm-pass: |
158 | 280 | runs-on: ubuntu-latest |
159 | 281 | needs: |
160 | | - - test |
| 282 | + - pytest |
| 283 | + - nftest |
161 | 284 | if: always() |
162 | 285 | steps: |
163 | 286 | - name: All tests ok |
|
0 commit comments