Skip to content

Commit 3b80bf9

Browse files
committed
Add separate test actions for Snakemake versions 7 to 9
1 parent 30b17be commit 3b80bf9

File tree

11 files changed

+176
-94
lines changed

11 files changed

+176
-94
lines changed

.github/workflows/install.yml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,7 @@ on: [push, pull_request]
44

55
jobs:
66

7-
skip_duplicate:
8-
permissions:
9-
actions: write
10-
contents: read
11-
runs-on: ubuntu-latest
12-
outputs:
13-
should_skip: ${{ steps.skip_check.outputs.should_skip }}
14-
steps:
15-
- id: skip_check
16-
uses: fkirc/skip-duplicate-actions@v5.3.0
17-
with:
18-
cancel_others: 'true'
19-
concurrent_skipping: 'same_content_newer'
20-
217
Install:
22-
needs: skip_duplicate
23-
if: ${{ needs.skip_duplicate.outputs.should_skip != 'true' }}
248
runs-on: ubuntu-latest
259
steps:
2610
- name: Checkout repository
@@ -31,14 +15,12 @@ jobs:
3115
channel-priority: strict
3216
activate-environment: snakemake
3317
auto-activate-base: false
34-
environment-file: .test/environment_7.32.4.yaml
18+
environment-file: .test/environment_v7.yaml
3519
- name: Create environments
3620
shell: bash -el {0}
37-
run: snakemake --snakefile workflow/Snakefile --directory .test --configfile config/config.yaml .test/targets.yaml --conda-create-envs-only --use-conda -c1 --conda-frontend conda
21+
run: snakemake --snakefile .test/Snakefile --configfile config/config.yaml .test/targets.yaml --conda-create-envs-only --use-conda -c1 --conda-frontend conda
3822

3923
Dry_run:
40-
needs: skip_duplicate
41-
if: ${{ needs.skip_duplicate.outputs.should_skip != 'true' }}
4224
runs-on: ubuntu-latest
4325
steps:
4426
- name: Checkout repository
@@ -49,7 +31,7 @@ jobs:
4931
channel-priority: strict
5032
activate-environment: snakemake
5133
auto-activate-base: false
52-
environment-file: .test/environment_7.32.4.yaml
34+
environment-file: .test/environment_v7.yaml
5335
- name: Dry run
5436
shell: bash -el {0}
55-
run: snakemake --snakefile workflow/Snakefile --directory .test --configfile config/config.yaml .test/targets.yaml --dry-run
37+
run: snakemake --snakefile .test/Snakefile --configfile config/config.yaml .test/targets.yaml --dry-run

.github/workflows/test.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/test_v7.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test Sm v7
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- dev
9+
pull_request:
10+
branches:
11+
- "**"
12+
13+
jobs:
14+
run_test_pipeline:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
- name: Setup environment
20+
uses: conda-incubator/setup-miniconda@v3
21+
with:
22+
channel-priority: strict
23+
activate-environment: snakemake
24+
auto-activate-base: false
25+
miniforge-version: latest
26+
environment-file: .test/environment_v7.yaml
27+
- name: Run test pipeline
28+
shell: bash -el {0}
29+
run: snakemake --snakefile .test/Snakefile --configfile config/config.yaml .test/targets.yaml --use-conda -c1 --conda-frontend conda
30+
- name: Pack logs
31+
if: success() || failure()
32+
shell: bash -el {0}
33+
run: tar czf logs.tar.gz .test/output .snakemake/log
34+
- name: Upload output file
35+
if: success() || failure()
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: output-logs
39+
path: logs.tar.gz

.github/workflows/test_v8.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test Sm v8
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- dev
9+
pull_request:
10+
branches:
11+
- "**"
12+
13+
jobs:
14+
run_test_pipeline:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
- name: Setup environment
20+
uses: conda-incubator/setup-miniconda@v3
21+
with:
22+
channel-priority: strict
23+
activate-environment: snakemake
24+
auto-activate-base: false
25+
miniforge-version: latest
26+
environment-file: .test/environment_v8.yaml
27+
- name: Run test pipeline
28+
shell: bash -el {0}
29+
run: snakemake --snakefile .test/Snakefile --configfile config/config.yaml .test/targets.yaml --use-conda -c1 --conda-frontend conda
30+
- name: Pack logs
31+
if: success() || failure()
32+
shell: bash -el {0}
33+
run: tar czf logs.tar.gz .test/output .snakemake/log
34+
- name: Upload output file
35+
if: success() || failure()
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: output-logs
39+
path: logs.tar.gz

.github/workflows/test_v9.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test Sm v9
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- dev
9+
pull_request:
10+
branches:
11+
- "**"
12+
13+
jobs:
14+
run_test_pipeline:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
- name: Setup environment
20+
uses: conda-incubator/setup-miniconda@v3
21+
with:
22+
channel-priority: strict
23+
activate-environment: snakemake
24+
auto-activate-base: false
25+
miniforge-version: latest
26+
environment-file: .test/environment_v9.yaml
27+
- name: Run test pipeline
28+
shell: bash -el {0}
29+
run: snakemake --snakefile .test/Snakefile --configfile config/config.yaml .test/targets.yaml -c1 --sdm conda
30+
- name: Pack logs
31+
if: success() || failure()
32+
shell: bash -el {0}
33+
run: tar czf logs.tar.gz .test/output .snakemake/log
34+
- name: Upload output file
35+
if: success() || failure()
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: output-logs
39+
path: logs.tar.gz

.test/Snakefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import sys
2+
import re
3+
from pathlib import Path
4+
from snakemake.utils import min_version
5+
import subprocess
6+
7+
8+
min_version("7.19")
9+
10+
# Workflow version
11+
__version__ = "1.2.1"
12+
13+
# Rules
14+
include: "../workflow/core.smk"
15+
include: "../workflow/rules/context.smk"
16+
include: "../workflow/rules/report.smk"
17+
18+
rule all:
19+
input:
20+
OUTDIR/f"{OUTPUT_NAME}.report.html"

.test/environment_v8.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: snakemake
2+
channels:
3+
- conda-forge
4+
- bioconda
5+
- defaults
6+
dependencies:
7+
- python==3.11.6
8+
- snakemake==8.30.0

.test/environment_v9.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: snakemake
2+
channels:
3+
- conda-forge
4+
- bioconda
5+
- defaults
6+
dependencies:
7+
- python==3.11.6
8+
- snakemake==9.1.6

.test/targets.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
SAMPLES:
22
sample1:
3-
bam: "data/bam/sample1.bam"
4-
fasta: "data/fasta/sample1.fasta"
3+
bam: ".test/data/bam/sample1.bam"
4+
fasta: ".test/data/fasta/sample1.fasta"
55
sample2:
6-
bam: "data/bam/sample2.bam"
7-
fasta: "data/fasta/sample2.fasta"
6+
bam: ".test/data/bam/sample2.bam"
7+
fasta: ".test/data/fasta/sample2.fasta"
88
sample3:
9-
bam: "data/bam/sample3.bam"
10-
fasta: "data/fasta/sample3.fasta"
9+
bam: ".test/data/bam/sample3.bam"
10+
fasta: ".test/data/fasta/sample3.fasta"
1111
METADATA:
12-
"data/metadata.csv"
12+
".test/data/metadata.csv"
1313
OUTPUT_DIRECTORY:
14-
"output"
14+
".test/output"
1515
CONTEXT_FASTA:
16-
"data/context.fasta"
16+
".test/data/context.fasta"
1717
OUTPUT_NAME:
1818
"test"
1919
DIVERSITY_REPS:
2020
10
2121
PLOTS:
22-
"../config/design_plots.R"
22+
"config/design_plots.R"
2323
PROBLEMATIC_VCF:
2424
"https://raw.githubusercontent.com/W-L/ProblematicSites_SARS-CoV2/da322c32004f7b16bdaa6a8ee7fd24d56e79d9dc/problematic_sites_sarsCov2.vcf"
2525
VC:
@@ -34,10 +34,10 @@ DEMIX:
3434
MIN_ABUNDANCE: 0.0001
3535
USE_BIONJ: false
3636
PLOT_GENOME_REGIONS:
37-
"../config/nsp_annotation.csv"
37+
"config/nsp_annotation.csv"
3838
REPORT_QMD:
39-
"../template.qmd"
39+
"template.qmd"
4040
FEATURES_JSON:
41-
"../config/sarscov2_features.json"
41+
"config/sarscov2_features.json"
4242
GENETIC_CODE_JSON:
43-
"../config/standard_genetic_code.json"
43+
"config/standard_genetic_code.json"

0 commit comments

Comments
 (0)