-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from bacpop/johanna_dev
Add command to merge sketch databases
- Loading branch information
Showing
25 changed files
with
656 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Cargo Build & Test | ||
|
||
on: | ||
push: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build_and_test: | ||
name: Rust project - latest | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
toolchain: | ||
- stable | ||
- beta | ||
- nightly | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} | ||
- run: cargo build --verbose | ||
- run: cargo test --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
on: push | ||
name: Clippy check | ||
jobs: | ||
clippy_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
components: clippy | ||
override: true | ||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --all-features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
# This runs on PRs so error can be seen before merging | ||
name: Version check | ||
|
||
jobs: | ||
all: | ||
runs-on: ubuntu-latest | ||
|
||
name: Version check | ||
|
||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check version format and availability | ||
run: ./scripts/version_check.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
# Usage: | ||
# check_version.sh | ||
# | ||
# Reads version from Cargo.toml and checks it against tags | ||
# | ||
# Credit to @richfitz for this from the dust package: | ||
# https://github.com/mrc-ide/dust/blob/master/scripts/version_check | ||
VERSION=${1:-$(grep '^version' Cargo.toml | sed 's/.*= *//' | sed 's/"//g')} | ||
TAG="v${VERSION}" | ||
|
||
echo "Proposed version number '$VERSION'" | ||
|
||
if echo "$VERSION" | grep -Eq "[0-9]+[.][0-9]+[.][0-9]+"; then | ||
echo "[OK] Version number in correct format" | ||
else | ||
echo "[ERROR] Invalid format version number '$VERSION' must be in format 'x.y.z'" | ||
exit 1 | ||
fi | ||
|
||
EXIT_CODE=0 | ||
|
||
echo "Updating remote git data" | ||
git fetch --quiet | ||
|
||
BRANCH_DEFAULT=$(git remote show origin | awk '/HEAD branch/ {print $NF}') | ||
LAST_TAG=$(git describe --tags --abbrev=0 "origin/${BRANCH_DEFAULT}") | ||
|
||
echo "Last tag was $LAST_TAG" | ||
|
||
if git rev-parse "$TAG" >/dev/null 2>&1; then | ||
echo "[ERROR] Tag $TAG already exists - update version number in Cargo.toml" | ||
exit 1 | ||
else | ||
echo "[OK] Version number not yet present as git tag" | ||
fi | ||
|
||
MAJOR=$(echo $VERSION | cut -d. -f1) | ||
MINOR=$(echo $VERSION | cut -d. -f2) | ||
PATCH=$(echo $VERSION | cut -d. -f3) | ||
|
||
LAST_VERSION=$(echo "$LAST_TAG" | sed 's/^v//') | ||
LAST_MAJOR=$(echo $LAST_VERSION | cut -d. -f1) | ||
LAST_MINOR=$(echo $LAST_VERSION | cut -d. -f2) | ||
LAST_PATCH=$(echo $LAST_VERSION | cut -d. -f3) | ||
|
||
if (( $MAJOR > $LAST_MAJOR )); then | ||
echo "[OK] Increasing MAJOR version" | ||
exit $EXIT_CODE | ||
elif (( $MINOR > $LAST_MINOR )); then | ||
echo "[OK] Increasing MINOR version" | ||
exit $EXIT_CODE | ||
elif (( $PATCH > $LAST_PATCH )); then | ||
echo "[OK] Increasing PATCH version" | ||
exit $EXIT_CODE | ||
else | ||
echo "[ERROR] Version number has not increased relative to $LAST_VERSION" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
use anyhow::Error; | ||
|
||
fn main() -> Result<(), Error> { | ||
sketchlib::main(); | ||
Ok(()) | ||
sketchlib::main() | ||
} |
Oops, something went wrong.