happy-eval 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. happy_eval-0.2.3/.github/workflows/benchmark.yml +180 -0
  2. happy_eval-0.2.3/.github/workflows/ci.yml +27 -0
  3. happy_eval-0.2.3/.github/workflows/container.yml +92 -0
  4. happy_eval-0.2.3/.github/workflows/docs.yml +43 -0
  5. happy_eval-0.2.3/.github/workflows/pypi.yml +92 -0
  6. happy_eval-0.2.3/.github/workflows/release.yml +71 -0
  7. happy_eval-0.2.3/.gitignore +6 -0
  8. happy_eval-0.2.3/Cargo.lock +764 -0
  9. happy_eval-0.2.3/Cargo.toml +28 -0
  10. happy_eval-0.2.3/Dockerfile +21 -0
  11. happy_eval-0.2.3/LICENSE +21 -0
  12. happy_eval-0.2.3/LICENSE-HAPPY.txt +68 -0
  13. happy_eval-0.2.3/LICENSE-RTG.txt +28 -0
  14. happy_eval-0.2.3/PKG-INFO +188 -0
  15. happy_eval-0.2.3/README.md +165 -0
  16. happy_eval-0.2.3/THIRD_PARTY_NOTICES.md +19 -0
  17. happy_eval-0.2.3/assets/benchmark-dark.svg +66 -0
  18. happy_eval-0.2.3/assets/benchmark-light.svg +66 -0
  19. happy_eval-0.2.3/docs/HAPPY_COMPATIBILITY.md +72 -0
  20. happy_eval-0.2.3/docs/assets/benchmark-dark.svg +66 -0
  21. happy_eval-0.2.3/docs/assets/benchmark-light.svg +66 -0
  22. happy_eval-0.2.3/docs/benchmarks.md +40 -0
  23. happy_eval-0.2.3/docs/cli.md +37 -0
  24. happy_eval-0.2.3/docs/index.md +36 -0
  25. happy_eval-0.2.3/docs/installation.md +55 -0
  26. happy_eval-0.2.3/docs/migration.md +64 -0
  27. happy_eval-0.2.3/install.sh +67 -0
  28. happy_eval-0.2.3/mkdocs.yml +51 -0
  29. happy_eval-0.2.3/packaging/bioconda/build.sh +8 -0
  30. happy_eval-0.2.3/packaging/bioconda/meta.yaml +54 -0
  31. happy_eval-0.2.3/packaging/nf-core/happyeval/environment.yml +7 -0
  32. happy_eval-0.2.3/packaging/nf-core/happyeval/main.nf +58 -0
  33. happy_eval-0.2.3/packaging/nf-core/happyeval/meta.yml +121 -0
  34. happy_eval-0.2.3/pyproject.toml +31 -0
  35. happy_eval-0.2.3/src/bed.rs +421 -0
  36. happy_eval-0.2.3/src/fasta.rs +224 -0
  37. happy_eval-0.2.3/src/main.rs +214 -0
  38. happy_eval-0.2.3/src/matcher.rs +2342 -0
  39. happy_eval-0.2.3/src/output.rs +991 -0
  40. happy_eval-0.2.3/src/vcf.rs +685 -0
  41. happy_eval-0.2.3/tests/cli_integration.rs +261 -0
  42. happy_eval-0.2.3/tests/fixtures/README.md +10 -0
  43. happy_eval-0.2.3/tests/fixtures/happy/fp_region_accuracy/expected.summary.csv +5 -0
  44. happy_eval-0.2.3/tests/fixtures/happy/fp_region_accuracy/expected.vcf +11 -0
  45. happy_eval-0.2.3/tests/fixtures/happy/fp_region_accuracy/fp.bed +6 -0
  46. happy_eval-0.2.3/tests/fixtures/happy/fp_region_accuracy/query.vcf +12 -0
  47. happy_eval-0.2.3/tests/fixtures/happy/fp_region_accuracy/strat.bed +4 -0
  48. happy_eval-0.2.3/tests/fixtures/happy/fp_region_accuracy/strat.tsv +1 -0
  49. happy_eval-0.2.3/tests/fixtures/happy/fp_region_accuracy/test.fa +14 -0
  50. happy_eval-0.2.3/tests/fixtures/happy/fp_region_accuracy/test.fa.fai +1 -0
  51. happy_eval-0.2.3/tests/fixtures/happy/fp_region_accuracy/truth.vcf +8 -0
  52. happy_eval-0.2.3/tests/fixtures/happy/haploid/expected.vcf +1 -0
  53. happy_eval-0.2.3/tests/fixtures/happy/haploid/query.vcf +5 -0
  54. happy_eval-0.2.3/tests/fixtures/happy/haploid/test.fa +2 -0
  55. happy_eval-0.2.3/tests/fixtures/happy/haploid/test.fa.fai +1 -0
  56. happy_eval-0.2.3/tests/fixtures/happy/haploid/truth.vcf +6 -0
  57. happy_eval-0.2.3/tests/fixtures/happy/leftshifting_example/expected.extended.csv +23 -0
  58. happy_eval-0.2.3/tests/fixtures/happy/leftshifting_example/expected.vcf +20 -0
  59. happy_eval-0.2.3/tests/fixtures/happy/leftshifting_example/query.vcf +19 -0
  60. happy_eval-0.2.3/tests/fixtures/happy/leftshifting_example/ref.fa +2 -0
  61. happy_eval-0.2.3/tests/fixtures/happy/leftshifting_example/ref.fa.fai +1 -0
  62. happy_eval-0.2.3/tests/fixtures/happy/leftshifting_example/truth.vcf +21 -0
  63. happy_eval-0.2.3/tests/fixtures/happy/numeric_chrs/chrfp.bed +3 -0
  64. happy_eval-0.2.3/tests/fixtures/happy/numeric_chrs/chrquery.vcf +9 -0
  65. happy_eval-0.2.3/tests/fixtures/happy/numeric_chrs/chrtest.fa +4 -0
  66. happy_eval-0.2.3/tests/fixtures/happy/numeric_chrs/chrtest.fa.fai +2 -0
  67. happy_eval-0.2.3/tests/fixtures/happy/numeric_chrs/chrtruth.vcf +7 -0
  68. happy_eval-0.2.3/tests/fixtures/happy/numeric_chrs/expected.summary.csv +3 -0
  69. happy_eval-0.2.3/tests/fixtures/happy/numeric_chrs/fp.bed +3 -0
  70. happy_eval-0.2.3/tests/fixtures/happy/numeric_chrs/query.vcf +9 -0
  71. happy_eval-0.2.3/tests/fixtures/happy/numeric_chrs/test.fa +4 -0
  72. happy_eval-0.2.3/tests/fixtures/happy/numeric_chrs/test.fa.fai +2 -0
  73. happy_eval-0.2.3/tests/fixtures/happy/numeric_chrs/truth.vcf +8 -0
  74. happy_eval-0.2.3/tests/fixtures/happy/per_sample_ft/chrQ.fa +31 -0
  75. happy_eval-0.2.3/tests/fixtures/happy/per_sample_ft/chrQ.fa.fai +6 -0
  76. happy_eval-0.2.3/tests/fixtures/happy/per_sample_ft/per_sample_ft_lhs.vcf +8 -0
  77. happy_eval-0.2.3/tests/fixtures/happy/per_sample_ft/per_sample_ft_rhs.vcf +12 -0
  78. happy_eval-0.2.3/tests/fixtures/happy/per_sample_ft/per_sample_ft_summary.csv +3 -0
  79. happy_eval-0.2.3/tests/fixtures/rtg_vcfeval/resources/vcfeval_ga4gh2_in_baseline.vcf +9 -0
  80. happy_eval-0.2.3/tests/fixtures/rtg_vcfeval/resources/vcfeval_ga4gh2_in_calls.vcf +9 -0
  81. happy_eval-0.2.3/tests/fixtures/rtg_vcfeval/resources/vcfeval_ga4gh2_in_template.fa +2 -0
  82. happy_eval-0.2.3/tests/fixtures/rtg_vcfeval/resources/vcfeval_ga4gh2_out_output.vcf +18 -0
  83. happy_eval-0.2.3/tests/fixtures/rtg_vcfeval/resources/vcfeval_ga4gh_in_baseline.vcf +28 -0
  84. happy_eval-0.2.3/tests/fixtures/rtg_vcfeval/resources/vcfeval_ga4gh_in_calls.vcf +22 -0
  85. happy_eval-0.2.3/tests/fixtures/rtg_vcfeval/resources/vcfeval_ga4gh_in_template.fa +10 -0
  86. happy_eval-0.2.3/tests/fixtures/rtg_vcfeval/resources/vcfeval_ga4gh_out_output.vcf +41 -0
  87. happy_eval-0.2.3/tests/happy_reference_suite.rs +363 -0
@@ -0,0 +1,180 @@
1
+ name: Native Linux Benchmark
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ permissions:
7
+ contents: read
8
+
9
+ jobs:
10
+ benchmark-linux-x86_64:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: dtolnay/rust-toolchain@stable
15
+ with:
16
+ targets: x86_64-unknown-linux-musl
17
+
18
+ - name: Print native Linux CPU & RAM info
19
+ run: |
20
+ uname -a
21
+ lscpu | grep -E "Model name|CPU\(s\)|Thread|Core" || true
22
+ free -h
23
+
24
+ - name: Build static x86_64-unknown-linux-musl binary
25
+ run: |
26
+ sudo apt-get update && sudo apt-get install -y musl-tools
27
+ cargo build --locked --release --target x86_64-unknown-linux-musl
28
+ cp target/x86_64-unknown-linux-musl/release/happy-eval /tmp/happy-eval
29
+ chmod +x /tmp/happy-eval
30
+ file /tmp/happy-eval
31
+ /tmp/happy-eval --version
32
+
33
+ - name: Fetch official hap.py chr21 Platinum Genomes datasets
34
+ run: |
35
+ mkdir -p /tmp/bench_data /tmp/bench_out
36
+ BASE="https://raw.githubusercontent.com/Illumina/hap.py/master/example"
37
+ for f in \
38
+ chr21.fa chr21.fa.fai \
39
+ happy/PG_NA12878_chr21.vcf.gz happy/PG_NA12878_chr21.vcf.gz.tbi \
40
+ happy/NA12878_chr21.vcf.gz happy/NA12878_chr21.vcf.gz.tbi \
41
+ happy/PG_Conf_chr21.bed.gz happy/PG_Conf_chr21.bed.gz.tbi \
42
+ happy/hg38.chr21.fa happy/hg38.chr21.fa.fai \
43
+ happy/PG_NA12878_hg38-chr21.vcf.gz happy/PG_NA12878_hg38-chr21.vcf.gz.tbi \
44
+ happy/NA12878-GATK3-chr21.vcf.gz happy/NA12878-GATK3-chr21.vcf.gz.tbi \
45
+ happy/PG_Conf_hg38-chr21.bed.gz \
46
+ happy/exons_hg38.bed.gz happy/exons_hg38.bed.gz.tbi \
47
+ happy/stratification.tsv; do
48
+ mkdir -p "/tmp/bench_data/$(dirname "$f")"
49
+ curl -fLsS "${BASE}/${f}" -o "/tmp/bench_data/${f}"
50
+ done
51
+
52
+ - name: Run apples-to-apples hap.py 0.3.15 vs happy-eval benchmark on native Linux x86_64
53
+ run: |
54
+ NCPU=$(nproc)
55
+ echo "Running with threads=${NCPU}"
56
+ IMG="genonet/hap-py@sha256:03acabe84bbfba35f5a7234129d524c563f5657e1f21150a2ea2797f8e6d05f2"
57
+ docker pull "$IMG" >/dev/null
58
+
59
+ docker run --rm \
60
+ -v /tmp/bench_data:/data:ro \
61
+ -v /tmp/happy-eval:/opt/happy-eval:ro \
62
+ -v /tmp/bench_out:/work \
63
+ -e RTG_MEM=4g \
64
+ -e NCPU="$NCPU" \
65
+ --entrypoint /bin/bash \
66
+ "$IMG" -c '
67
+ set -euo pipefail
68
+ cp /data/chr21.fa /data/chr21.fa.fai /tmp/
69
+ cp /data/happy/PG_NA12878_chr21.vcf.gz /data/happy/PG_NA12878_chr21.vcf.gz.tbi /tmp/
70
+ cp /data/happy/NA12878_chr21.vcf.gz /data/happy/NA12878_chr21.vcf.gz.tbi /tmp/
71
+ cp /data/happy/PG_Conf_chr21.bed.gz /data/happy/PG_Conf_chr21.bed.gz.tbi /tmp/
72
+ cp /data/happy/hg38.chr21.fa /data/happy/hg38.chr21.fa.fai /tmp/
73
+ cp /data/happy/PG_NA12878_hg38-chr21.vcf.gz /data/happy/PG_NA12878_hg38-chr21.vcf.gz.tbi /tmp/
74
+ cp /data/happy/NA12878-GATK3-chr21.vcf.gz /data/happy/NA12878-GATK3-chr21.vcf.gz.tbi /tmp/
75
+ cp /data/happy/PG_Conf_hg38-chr21.bed.gz /tmp/
76
+ cp /data/happy/exons_hg38.bed.gz /data/happy/exons_hg38.bed.gz.tbi /data/happy/stratification.tsv /tmp/
77
+
78
+ python - << "PYEOF"
79
+ import subprocess, time, resource, os, sys, json
80
+
81
+ ncpu = os.environ.get("NCPU", "4")
82
+ rtg = "/opt/hap.py/libexec/rtg-tools-install/rtg"
83
+ if not os.path.exists(rtg):
84
+ rtg = "rtg"
85
+
86
+ def bench(name, cmd):
87
+ wrapper = [
88
+ "python", "-c",
89
+ "import subprocess, time, resource, json, sys\n"
90
+ "t0 = time.time()\n"
91
+ "p = subprocess.Popen(sys.argv[1:], stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n"
92
+ "out, err = p.communicate()\n"
93
+ "dt = time.time() - t0\n"
94
+ "rss = resource.getrusage(resource.RUSAGE_CHILDREN).ru_maxrss\n"
95
+ "if p.returncode != 0:\n"
96
+ " sys.stderr.write(err[-1500:])\n"
97
+ " sys.exit(p.returncode)\n"
98
+ "sys.stdout.write(json.dumps({\"wall_s\": dt, \"max_rss_mb\": rss / 1024.0}))\n"
99
+ ] + cmd
100
+ res = json.loads(subprocess.check_output(wrapper))
101
+ sys.stdout.write("%-44s wall=%7.3fs max_rss=%7.1f MB\n" % (name, res["wall_s"], res["max_rss_mb"]))
102
+ sys.stdout.flush()
103
+ return res
104
+
105
+ bench("rtg format hg19 chr21", [rtg, "format", "-o", "/tmp/chr21.sdf", "/tmp/chr21.fa"])
106
+ bench("rtg format hg38 chr21", [rtg, "format", "-o", "/tmp/hg38.chr21.sdf", "/tmp/hg38.chr21.fa"])
107
+
108
+ # 1. NA12878 chr21 hg19
109
+ h1_default = bench("hap.py 0.3.15 hg19 (vcfeval, default)", [
110
+ "/opt/hap.py/bin/hap.py",
111
+ "/tmp/PG_NA12878_chr21.vcf.gz", "/tmp/NA12878_chr21.vcf.gz",
112
+ "-f", "/tmp/PG_Conf_chr21.bed.gz", "-r", "/tmp/chr21.fa", "-l", "chr21",
113
+ "--engine=vcfeval", "--threads", ncpu, "-o", "/work/happy_hg19_default",
114
+ ])
115
+ h1_warm = bench("hap.py 0.3.15 hg19 (vcfeval, warm SDF --no-roc)", [
116
+ "/opt/hap.py/bin/hap.py",
117
+ "/tmp/PG_NA12878_chr21.vcf.gz", "/tmp/NA12878_chr21.vcf.gz",
118
+ "-f", "/tmp/PG_Conf_chr21.bed.gz", "-r", "/tmp/chr21.fa", "-l", "chr21",
119
+ "--engine=vcfeval", "--engine-vcfeval-template", "/tmp/chr21.sdf",
120
+ "--threads", ncpu, "--no-roc", "-o", "/work/happy_hg19_warm",
121
+ ])
122
+ he1 = bench("happy-eval hg19 (static musl)", [
123
+ "/opt/happy-eval",
124
+ "--truth", "/tmp/PG_NA12878_chr21.vcf.gz", "--query", "/tmp/NA12878_chr21.vcf.gz",
125
+ "--bed", "/tmp/PG_Conf_chr21.bed.gz", "--ref", "/tmp/chr21.fa", "--region", "chr21",
126
+ "--threads", ncpu, "--quiet", "-o", "/work/he_hg19",
127
+ ])
128
+ he1_vcf = bench("happy-eval hg19 (static musl + --write-vcf)", [
129
+ "/opt/happy-eval",
130
+ "--truth", "/tmp/PG_NA12878_chr21.vcf.gz", "--query", "/tmp/NA12878_chr21.vcf.gz",
131
+ "--bed", "/tmp/PG_Conf_chr21.bed.gz", "--ref", "/tmp/chr21.fa", "--region", "chr21",
132
+ "--threads", ncpu, "--write-vcf", "--quiet", "-o", "/work/he_hg19_vcf",
133
+ ])
134
+
135
+ # 2. NA12878 chr21 hg38 GATK3 + exons stratification
136
+ h2_default = bench("hap.py 0.3.15 hg38 GATK3+exons (default)", [
137
+ "/opt/hap.py/bin/hap.py",
138
+ "/tmp/PG_NA12878_hg38-chr21.vcf.gz", "/tmp/NA12878-GATK3-chr21.vcf.gz",
139
+ "-f", "/tmp/PG_Conf_hg38-chr21.bed.gz", "-r", "/tmp/hg38.chr21.fa", "-l", "chr21",
140
+ "--engine=vcfeval", "--stratification", "/tmp/stratification.tsv",
141
+ "--threads", ncpu, "-o", "/work/happy_hg38_default",
142
+ ])
143
+ h2_warm = bench("hap.py 0.3.15 hg38 GATK3+exons (warm --no-roc)", [
144
+ "/opt/hap.py/bin/hap.py",
145
+ "/tmp/PG_NA12878_hg38-chr21.vcf.gz", "/tmp/NA12878-GATK3-chr21.vcf.gz",
146
+ "-f", "/tmp/PG_Conf_hg38-chr21.bed.gz", "-r", "/tmp/hg38.chr21.fa", "-l", "chr21",
147
+ "--engine=vcfeval", "--engine-vcfeval-template", "/tmp/hg38.chr21.sdf",
148
+ "--stratification", "/tmp/stratification.tsv",
149
+ "--threads", ncpu, "--no-roc", "-o", "/work/happy_hg38_warm",
150
+ ])
151
+ he2 = bench("happy-eval hg38 GATK3+exons (static musl)", [
152
+ "/opt/happy-eval",
153
+ "--truth", "/tmp/PG_NA12878_hg38-chr21.vcf.gz", "--query", "/tmp/NA12878-GATK3-chr21.vcf.gz",
154
+ "--bed", "/tmp/PG_Conf_hg38-chr21.bed.gz", "--ref", "/tmp/hg38.chr21.fa", "--region", "chr21",
155
+ "--stratifications", "/tmp/stratification.tsv",
156
+ "--threads", ncpu, "--quiet", "-o", "/work/he_hg38",
157
+ ])
158
+ he2_vcf = bench("happy-eval hg38 GATK3+exons (+ --write-vcf)", [
159
+ "/opt/happy-eval",
160
+ "--truth", "/tmp/PG_NA12878_hg38-chr21.vcf.gz", "--query", "/tmp/NA12878-GATK3-chr21.vcf.gz",
161
+ "--bed", "/tmp/PG_Conf_hg38-chr21.bed.gz", "--ref", "/tmp/hg38.chr21.fa", "--region", "chr21",
162
+ "--stratifications", "/tmp/stratification.tsv",
163
+ "--threads", ncpu, "--write-vcf", "--quiet", "-o", "/work/he_hg38_vcf",
164
+ ])
165
+
166
+ sys.stdout.write("\n=== SPEEDUP SUMMARY (native Linux x86_64, %s threads) ===\n" % ncpu)
167
+ sys.stdout.write("hg19 vs hap.py default: %.1fx (%.2fs vs %.2fs) | RAM %.1fx less\n" % (
168
+ h1_default["wall_s"] / he1["wall_s"], h1_default["wall_s"], he1["wall_s"],
169
+ h1_default["max_rss_mb"] / he1["max_rss_mb"]))
170
+ sys.stdout.write("hg19 vs hap.py warm --no-roc: %.1fx (%.2fs vs %.2fs) | RAM %.1fx less\n" % (
171
+ h1_warm["wall_s"] / he1["wall_s"], h1_warm["wall_s"], he1["wall_s"],
172
+ h1_warm["max_rss_mb"] / he1["max_rss_mb"]))
173
+ sys.stdout.write("hg38+exons vs hap.py default: %.1fx (%.2fs vs %.2fs) | RAM %.1fx less\n" % (
174
+ h2_default["wall_s"] / he2["wall_s"], h2_default["wall_s"], he2["wall_s"],
175
+ h2_default["max_rss_mb"] / he2["max_rss_mb"]))
176
+ sys.stdout.write("hg38+exons vs hap.py warm: %.1fx (%.2fs vs %.2fs) | RAM %.1fx less\n" % (
177
+ h2_warm["wall_s"] / he2["wall_s"], h2_warm["wall_s"], he2["wall_s"],
178
+ h2_warm["max_rss_mb"] / he2["max_rss_mb"]))
179
+ PYEOF
180
+ '
@@ -0,0 +1,27 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ test:
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ubuntu-latest, macos-latest]
16
+ runs-on: ${{ matrix.os }}
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: dtolnay/rust-toolchain@stable
20
+ with:
21
+ components: clippy
22
+ - name: Test release build
23
+ run: cargo test --locked --release
24
+ - name: Clippy
25
+ run: cargo clippy --locked --all-targets -- -D warnings
26
+ - name: Check binary
27
+ run: cargo run --locked --release -- --version
@@ -0,0 +1,92 @@
1
+ name: Publish container image
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+ inputs:
8
+ tag:
9
+ description: "Release tag to package (e.g. v0.2.3); defaults to latest release"
10
+ required: false
11
+ default: ""
12
+
13
+ permissions:
14
+ contents: read
15
+ packages: write
16
+
17
+ jobs:
18
+ docker:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - name: Resolve release tag
22
+ id: meta
23
+ env:
24
+ GH_TOKEN: ${{ github.token }}
25
+ run: |
26
+ TAG="${{ github.event.inputs.tag || github.event.release.tag_name }}"
27
+ if [ -z "$TAG" ]; then
28
+ TAG=$(gh release view --repo "$GITHUB_REPOSITORY" --json tagName --jq '.tagName')
29
+ fi
30
+ VERSION="${TAG#v}"
31
+ echo "tag=$TAG" >> "$GITHUB_OUTPUT"
32
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
33
+ echo "Packaging $TAG (version $VERSION)"
34
+
35
+ - name: Download pre-built static Linux musl binaries
36
+ env:
37
+ GH_TOKEN: ${{ github.token }}
38
+ run: |
39
+ mkdir -p ctx/amd64 ctx/arm64
40
+ gh release download "${{ steps.meta.outputs.tag }}" \
41
+ --repo "$GITHUB_REPOSITORY" \
42
+ -p 'happy-eval-linux-x86_64.tar.gz' \
43
+ -p 'happy-eval-linux-aarch64.tar.gz' \
44
+ -D ctx
45
+ tar -xzf ctx/happy-eval-linux-x86_64.tar.gz -C ctx/amd64 happy-eval
46
+ tar -xzf ctx/happy-eval-linux-aarch64.tar.gz -C ctx/arm64 happy-eval
47
+ chmod +x ctx/amd64/happy-eval ctx/arm64/happy-eval
48
+
49
+ - name: Write release Dockerfile
50
+ run: |
51
+ cat <<'EOF' > ctx/Dockerfile
52
+ FROM alpine:3.21
53
+ ARG TARGETARCH
54
+ RUN apk add --no-cache bash procps ca-certificates
55
+ COPY ${TARGETARCH}/happy-eval /usr/local/bin/happy-eval
56
+ CMD ["happy-eval", "--help"]
57
+ EOF
58
+
59
+ - name: Set up QEMU
60
+ uses: docker/setup-qemu-action@v3
61
+
62
+ - name: Set up Docker Buildx
63
+ uses: docker/setup-buildx-action@v3
64
+
65
+ - name: Log in to GitHub Container Registry
66
+ uses: docker/login-action@v3
67
+ with:
68
+ registry: ghcr.io
69
+ username: ${{ github.actor }}
70
+ password: ${{ secrets.GITHUB_TOKEN }}
71
+
72
+ - name: Build and push multi-arch image
73
+ uses: docker/build-push-action@v6
74
+ with:
75
+ context: ctx
76
+ file: ctx/Dockerfile
77
+ platforms: linux/amd64,linux/arm64
78
+ push: true
79
+ tags: |
80
+ ghcr.io/thomasvangurp/happy-eval:${{ steps.meta.outputs.version }}
81
+ ghcr.io/thomasvangurp/happy-eval:latest
82
+ labels: |
83
+ org.opencontainers.image.source=https://github.com/thomasvangurp/happy-eval-rs
84
+ org.opencontainers.image.url=https://github.com/thomasvangurp/happy-eval-rs
85
+ org.opencontainers.image.version=${{ steps.meta.outputs.version }}
86
+ org.opencontainers.image.description=Fast, dependency-free Rust replacement for hap.py and rtg vcfeval variant benchmarking
87
+ org.opencontainers.image.licenses=MIT
88
+
89
+ - name: Smoke test published image
90
+ run: |
91
+ docker run --rm ghcr.io/thomasvangurp/happy-eval:${{ steps.meta.outputs.version }} happy-eval --version
92
+ docker run --rm ghcr.io/thomasvangurp/happy-eval:${{ steps.meta.outputs.version }} bash -c "ps >/dev/null && echo Nextflow-ready"
@@ -0,0 +1,43 @@
1
+ name: Deploy documentation
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - "docs/**"
8
+ - "mkdocs.yml"
9
+ - ".github/workflows/docs.yml"
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
14
+ pages: write
15
+ id-token: write
16
+
17
+ concurrency:
18
+ group: pages
19
+ cancel-in-progress: false
20
+
21
+ jobs:
22
+ build:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - uses: astral-sh/setup-uv@v5
27
+ - name: Build MkDocs site
28
+ run: uvx --with mkdocs-material mkdocs build --strict
29
+ - uses: actions/configure-pages@v5
30
+ - uses: actions/upload-pages-artifact@v3
31
+ with:
32
+ path: site
33
+
34
+ deploy:
35
+ environment:
36
+ name: github-pages
37
+ url: ${{ steps.deployment.outputs.page_url }}
38
+ runs-on: ubuntu-latest
39
+ needs: build
40
+ steps:
41
+ - name: Deploy to GitHub Pages
42
+ id: deployment
43
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,92 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+ inputs:
8
+ publish:
9
+ description: "Upload built wheels and sdist to PyPI (requires Trusted Publisher configured on pypi.org)"
10
+ type: boolean
11
+ default: true
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ linux:
18
+ runs-on: ${{ matrix.os }}
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ include:
23
+ - os: ubuntu-latest
24
+ target: x86_64
25
+ manylinux: 2_28
26
+ - os: ubuntu-24.04-arm
27
+ target: aarch64
28
+ manylinux: 2_28
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - name: Build wheel (${{ matrix.target }})
32
+ uses: PyO3/maturin-action@v1
33
+ with:
34
+ target: ${{ matrix.target }}
35
+ args: --release --out dist
36
+ manylinux: ${{ matrix.manylinux }}
37
+ - uses: actions/upload-artifact@v4
38
+ with:
39
+ name: wheels-linux-${{ matrix.target }}
40
+ path: dist
41
+
42
+ macos:
43
+ runs-on: macos-latest
44
+ strategy:
45
+ fail-fast: false
46
+ matrix:
47
+ target: [aarch64-apple-darwin, x86_64-apple-darwin]
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+ - uses: dtolnay/rust-toolchain@stable
51
+ with:
52
+ targets: ${{ matrix.target }}
53
+ - name: Build wheel (${{ matrix.target }})
54
+ uses: PyO3/maturin-action@v1
55
+ with:
56
+ target: ${{ matrix.target }}
57
+ args: --release --out dist
58
+ - uses: actions/upload-artifact@v4
59
+ with:
60
+ name: wheels-macos-${{ matrix.target }}
61
+ path: dist
62
+
63
+ sdist:
64
+ runs-on: ubuntu-latest
65
+ steps:
66
+ - uses: actions/checkout@v4
67
+ - name: Build sdist
68
+ uses: PyO3/maturin-action@v1
69
+ with:
70
+ command: sdist
71
+ args: --out dist
72
+ - uses: actions/upload-artifact@v4
73
+ with:
74
+ name: wheels-sdist
75
+ path: dist
76
+
77
+ publish:
78
+ if: github.event_name == 'release' || inputs.publish == true
79
+ needs: [linux, macos, sdist]
80
+ runs-on: ubuntu-latest
81
+ environment: pypi
82
+ permissions:
83
+ id-token: write
84
+ steps:
85
+ - uses: actions/download-artifact@v4
86
+ with:
87
+ path: dist
88
+ merge-multiple: true
89
+ - name: Publish to PyPI
90
+ uses: pypa/gh-action-pypi-publish@release/v1
91
+ with:
92
+ packages-dir: dist
@@ -0,0 +1,71 @@
1
+ name: Release binaries
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ permissions:
8
+ contents: write
9
+
10
+ jobs:
11
+ build:
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ include:
16
+ - os: ubuntu-latest
17
+ target: x86_64-unknown-linux-musl
18
+ archive: happy-eval-linux-x86_64.tar.gz
19
+ - os: ubuntu-24.04-arm
20
+ target: aarch64-unknown-linux-musl
21
+ archive: happy-eval-linux-aarch64.tar.gz
22
+ - os: macos-latest
23
+ target: aarch64-apple-darwin
24
+ archive: happy-eval-macos-aarch64.tar.gz
25
+ - os: macos-latest
26
+ target: x86_64-apple-darwin
27
+ archive: happy-eval-macos-x86_64.tar.gz
28
+ runs-on: ${{ matrix.os }}
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: dtolnay/rust-toolchain@stable
32
+ with:
33
+ targets: ${{ matrix.target }}
34
+ - name: Install musl tools (Linux)
35
+ if: runner.os == 'Linux'
36
+ run: sudo apt-get update && sudo apt-get install -y musl-tools
37
+ - name: Test
38
+ run: cargo test --locked --release
39
+ - name: Build static binary
40
+ run: cargo build --locked --release --target ${{ matrix.target }}
41
+ - name: Package
42
+ shell: bash
43
+ run: |
44
+ cp target/${{ matrix.target }}/release/happy-eval happy-eval
45
+ tar -czf ${{ matrix.archive }} happy-eval README.md LICENSE LICENSE-RTG.txt LICENSE-HAPPY.txt THIRD_PARTY_NOTICES.md
46
+ if command -v sha256sum >/dev/null; then
47
+ sha256sum ${{ matrix.archive }} > ${{ matrix.archive }}.sha256
48
+ else
49
+ shasum -a 256 ${{ matrix.archive }} > ${{ matrix.archive }}.sha256
50
+ fi
51
+ - uses: actions/upload-artifact@v4
52
+ with:
53
+ name: ${{ matrix.target }}
54
+ path: |
55
+ ${{ matrix.archive }}
56
+ ${{ matrix.archive }}.sha256
57
+
58
+ publish:
59
+ needs: build
60
+ runs-on: ubuntu-latest
61
+ steps:
62
+ - uses: actions/download-artifact@v4
63
+ with:
64
+ path: dist
65
+ merge-multiple: true
66
+ - name: Assemble checksums
67
+ run: cat dist/*.sha256 > dist/SHA256SUMS
68
+ - name: Create release
69
+ env:
70
+ GH_TOKEN: ${{ github.token }}
71
+ run: gh release create "$GITHUB_REF_NAME" dist/*.tar.gz dist/SHA256SUMS --repo "$GITHUB_REPOSITORY" --generate-notes --verify-tag
@@ -0,0 +1,6 @@
1
+ /target/
2
+ /.DS_Store
3
+ *.profraw
4
+ *.tmp
5
+
6
+ site/