Skip to content

Commit 3382688

Browse files
authored
v1.0.0
1 parent dc83f39 commit 3382688

14 files changed

Lines changed: 3640 additions & 469 deletions

File tree

.github/workflows/check.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# adapted from https://github.com/jonhoo/rust-ci-conf/blob/fabb82abd53e0052c8b70ae197a80e6203ede26d/.github/workflows/check.yml
2+
# This workflow runs whenever a PR is opened or updated, or a commit is pushed to main. It runs
3+
# several checks:
4+
# - fmt: checks that the code is formatted according to rustfmt
5+
# - clippy: checks that the code does not contain any clippy warnings
6+
# - doc: checks that the code can be documented without errors
7+
# - hack: check combinations of feature flags
8+
# - msrv: check that the msrv specified in the crate is correct
9+
permissions:
10+
contents: read
11+
# This configuration allows maintainers of this repo to create a branch and pull request based on
12+
# the new branch. Restricting the push trigger to the main branch ensures that the PR only gets
13+
# built once.
14+
on:
15+
push:
16+
branches: [ main ]
17+
pull_request:
18+
# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that
19+
# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
22+
cancel-in-progress: true
23+
name: check
24+
jobs:
25+
fmt:
26+
runs-on: ubuntu-latest
27+
name: stable / fmt
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
submodules: true
32+
- name: Install stable
33+
uses: dtolnay/rust-toolchain@stable
34+
with:
35+
components: rustfmt
36+
- name: cargo fmt --check
37+
run: cargo fmt --check
38+
clippy:
39+
runs-on: ubuntu-latest
40+
name: ${{ matrix.toolchain }} / clippy
41+
permissions:
42+
contents: read
43+
checks: write
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
# Get early warning of new lints which are regularly introduced in beta channels.
48+
toolchain: [ stable, beta ]
49+
steps:
50+
- uses: actions/checkout@v4
51+
with:
52+
submodules: true
53+
- name: Install ${{ matrix.toolchain }}
54+
uses: dtolnay/rust-toolchain@master
55+
with:
56+
toolchain: ${{ matrix.toolchain }}
57+
components: clippy
58+
- name: cargo clippy
59+
uses: giraffate/clippy-action@v1
60+
with:
61+
reporter: 'github-pr-check'
62+
github_token: ${{ secrets.GITHUB_TOKEN }}
63+
hack:
64+
# cargo-hack checks combinations of feature flags to ensure that features are all additive
65+
# which is required for feature unification
66+
runs-on: ubuntu-latest
67+
name: ubuntu / stable / features
68+
steps:
69+
- uses: actions/checkout@v4
70+
with:
71+
submodules: true
72+
- name: Install stable
73+
uses: dtolnay/rust-toolchain@stable
74+
- name: cargo install cargo-hack
75+
uses: taiki-e/install-action@cargo-hack
76+
# intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4
77+
# --feature-powerset runs for every combination of features
78+
- name: cargo hack
79+
run: cargo hack --feature-powerset check
80+
msrv:
81+
# check that we can build using the minimal rust version that is specified by this crate
82+
runs-on: ubuntu-latest
83+
# we use a matrix here just because env can't be used in job names
84+
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
85+
strategy:
86+
matrix:
87+
msrv: [ "1.87.0" ] # obtained from cargo-msrv 24/01/2026
88+
name: ubuntu / ${{ matrix.msrv }}
89+
steps:
90+
- uses: actions/checkout@v4
91+
with:
92+
submodules: true
93+
- name: Install ${{ matrix.msrv }}
94+
uses: dtolnay/rust-toolchain@master
95+
with:
96+
toolchain: ${{ matrix.msrv }}
97+
- name: cargo +${{ matrix.msrv }} check
98+
run: cargo check

.github/workflows/release.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# inspried by https://github.com/mbhall88/lrge/blob/main/.github/workflows/release.yml
2+
name: Release
3+
4+
on:
5+
push:
6+
tags:
7+
- "[0-9]+.[0-9]+.[0-9]+"
8+
9+
env:
10+
CICD_INTERMEDIATES_DIR: "_release-intermediates"
11+
12+
jobs:
13+
upload:
14+
name: ${{ matrix.job.os }} (${{ matrix.job.target }})
15+
permissions:
16+
contents: write
17+
runs-on: ${{ matrix.job.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
job:
22+
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, use-cross: true }
23+
- { os: ubuntu-latest, target: aarch64-unknown-linux-gnu, use-cross: true }
24+
- { os: macos-13, target: x86_64-apple-darwin, use-cross: true }
25+
- { os: macos-latest, target: aarch64-apple-darwin, use-cross: true }
26+
steps:
27+
- name: Checkout source code
28+
uses: actions/checkout@v4
29+
30+
- name: Extract crate information
31+
shell: bash
32+
run: |
33+
echo "PROJECT_NAME=hashfasta" >> $GITHUB_ENV
34+
echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' lrge/Cargo.toml | head -n1)" >> $GITHUB_ENV
35+
echo "PROJECT_MAINTAINER=$(sed -n 's/^authors = \["\(.*\)"\]/\1/p' Cargo.toml)" >> $GITHUB_ENV
36+
echo "PROJECT_HOMEPAGE=$(sed -n 's/^homepage = "\(.*\)"/\1/p' Cargo.toml)" >> $GITHUB_ENV
37+
38+
- name: Install toolchain
39+
uses: dtolnay/rust-toolchain@stable
40+
with:
41+
targets: ${{ matrix.job.target }}
42+
43+
- name: Show version information (Rust, cargo, GCC)
44+
shell: bash
45+
run: |
46+
gcc --version || true
47+
rustup -V
48+
rustup toolchain list
49+
rustup default
50+
cargo -V
51+
rustc -V
52+
53+
- name: Install cross
54+
uses: taiki-e/install-action@v2
55+
with:
56+
tool: cross@0.2.5
57+
58+
- name: Build with cross
59+
run: cross build --release --target=${{ matrix.job.target }}
60+
61+
- name: Set binary name & path
62+
id: bin
63+
shell: bash
64+
run: |
65+
# Figure out suffix of binary
66+
EXE_suffix=""
67+
case ${{ matrix.job.target }} in
68+
*-pc-windows-*) EXE_suffix=".exe" ;;
69+
esac;
70+
71+
# Setup paths
72+
BIN_NAME="${{ env.PROJECT_NAME }}${EXE_suffix}"
73+
BIN_PATH="target/${{ matrix.job.target }}/release/${BIN_NAME}"
74+
75+
# Let subsequent steps know where to find the binary
76+
echo "BIN_PATH=${BIN_PATH}" >> $GITHUB_OUTPUT
77+
echo "BIN_NAME=${BIN_NAME}" >> $GITHUB_OUTPUT
78+
79+
- name: Create tarball
80+
id: package
81+
shell: bash
82+
run: |
83+
PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac;
84+
PKG_BASENAME=${PROJECT_NAME}-${PROJECT_VERSION}-${{ matrix.job.target }}
85+
PKG_NAME=${PKG_BASENAME}${PKG_suffix}
86+
echo "PKG_NAME=${PKG_NAME}" >> $GITHUB_OUTPUT
87+
PKG_STAGING="${{ env.CICD_INTERMEDIATES_DIR }}/package"
88+
ARCHIVE_DIR="${PKG_STAGING}/${PKG_BASENAME}/"
89+
mkdir -p "${ARCHIVE_DIR}"
90+
91+
# Binary
92+
cp "${{ steps.bin.outputs.BIN_PATH }}" "$ARCHIVE_DIR"
93+
94+
# README, LICENSE and CHANGELOG files
95+
cp "README.md" "LICENSE" "CHANGELOG.md" "$ARCHIVE_DIR"
96+
97+
# base compressed package
98+
pushd "${PKG_STAGING}/" >/dev/null
99+
case ${{ matrix.job.target }} in
100+
*-pc-windows-*) 7z -y a "${PKG_NAME}" "${PKG_BASENAME}"/* | tail -2 ;;
101+
*) tar czf "${PKG_NAME}" "${PKG_BASENAME}"/* ;;
102+
esac;
103+
popd >/dev/null
104+
105+
# Let subsequent steps know where to find the compressed package
106+
echo "PKG_PATH=${PKG_STAGING}/${PKG_NAME}" >> $GITHUB_OUTPUT
107+
108+
- name: "Artifact upload: tarball"
109+
uses: actions/upload-artifact@master
110+
with:
111+
name: ${{ steps.package.outputs.PKG_NAME }}
112+
path: ${{ steps.package.outputs.PKG_PATH }}
113+
114+
- name: Check for release
115+
id: is-release
116+
shell: bash
117+
run: |
118+
unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/[0-9].* ]]; then IS_RELEASE='true' ; fi
119+
echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT
120+
121+
- name: Publish archives and packages
122+
uses: softprops/action-gh-release@v2
123+
if: steps.is-release.outputs.IS_RELEASE
124+
with:
125+
files: |
126+
${{ steps.package.outputs.PKG_PATH }}
127+
env:
128+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# adapted from https://github.com/jonhoo/rust-ci-conf/blob/fabb82abd53e0052c8b70ae197a80e6203ede26d/.github/workflows/test.yml
2+
# This is the main CI workflow that runs the test suite on all pushes to main and all pull requests.
3+
# It runs the following jobs:
4+
# - required: runs the test suite on ubuntu with stable and beta rust toolchains
5+
# - minimal: runs the test suite with the minimal versions of the dependencies that satisfy the
6+
# requirements of this crate, and its dependencies
7+
# - os-check: runs the test suite on mac and windows
8+
# See check.yml for information about how the concurrency cancellation and workflow triggering works
9+
permissions:
10+
contents: read
11+
on:
12+
push:
13+
branches: [ main ]
14+
pull_request:
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
17+
cancel-in-progress: true
18+
name: test
19+
jobs:
20+
required:
21+
runs-on: ubuntu-latest
22+
name: ubuntu / ${{ matrix.toolchain }}
23+
strategy:
24+
matrix:
25+
# run on stable and beta to ensure that tests won't break on the next version of the rust
26+
# toolchain
27+
toolchain: [ stable, beta ]
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
submodules: true
32+
- name: Install ${{ matrix.toolchain }}
33+
uses: dtolnay/rust-toolchain@master
34+
with:
35+
toolchain: ${{ matrix.toolchain }}
36+
- name: cargo generate-lockfile
37+
# enable this ci template to run regardless of whether the lockfile is checked in or not
38+
if: hashFiles('Cargo.lock') == ''
39+
run: cargo generate-lockfile
40+
# https://twitter.com/jonhoo/status/1571290371124260865
41+
- name: cargo test --locked
42+
run: cargo test --locked --all-features --all-targets
43+
os-check:
44+
# run cargo test on mac and windows
45+
runs-on: ${{ matrix.os }}
46+
name: ${{ matrix.os }} / stable
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
os: [ macos-latest ]
51+
steps:
52+
# if your project needs OpenSSL, uncomment this to fix Windows builds.
53+
# it's commented out by default as the install command takes 5-10m.
54+
# - run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
55+
# if: runner.os == 'Windows'
56+
# - run: vcpkg install openssl:x64-windows-static-md
57+
# if: runner.os == 'Windows'
58+
- uses: actions/checkout@v4
59+
with:
60+
submodules: true
61+
- name: Install stable
62+
uses: dtolnay/rust-toolchain@stable
63+
- name: cargo generate-lockfile
64+
if: hashFiles('Cargo.lock') == ''
65+
run: cargo generate-lockfile
66+
- name: cargo test
67+
run: cargo test --locked --all-features --all-targets

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2026-01-24
9+
10+
### Added
11+
- GitHub Actions workflows for `check`, `test`, and `release`
12+
- Rewrite of entire core functionality:
13+
- New subcommands: `hash`, `unique`, `duplicate`, replacing previous flag-based interface.
14+
- Multi-threaded parsing
15+
- Ability to read FASTX from stdin, http/https URLs, and ssh paths.
16+
- Quiet mode (`--quiet`) to suppress per-record output in `hash` subcommand.
17+
- JSON output mode (`--json`)
18+
- Strict mode (`--strict`) to fail on non-ACGTUN- bases.
19+
20+
21+
### Changed
22+
- CLI interface is now subcommand-based
23+
- Hashing now uses `xxhash3_64`
24+
- Parsing switched from `noodles` to `paraseq` with parallel processing.
25+
26+
### Removed
27+
- Selectable hash algorithms (`--seqhash`, `--finalhash`).
28+
- CLI flags `--individual`, `--duplicates`, `--fasta`, and `--fastq` (replaced by subcommands).

0 commit comments

Comments
 (0)