Skip to content

Commit

Permalink
Merge pull request #44 from Project-Fungus/release-v1
Browse files Browse the repository at this point in the history
Release v1.0.0
  • Loading branch information
louis-hildebrand authored Dec 18, 2023
2 parents 8e01dd8 + 44ea8a4 commit a971ac7
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 23 deletions.
99 changes: 96 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
release:
description: 'Build for release?'
required: true
default: false
type: boolean

env:
CARGO_TERM_COLOR: always

jobs:
build:

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build
Expand All @@ -24,3 +29,91 @@ jobs:
run: cargo clippy -- -Dclippy::complexity -Dclippy::perf -Dclippy::suspicious -Dclippy::style
- name: Format
run: cargo fmt --check
# Based on the release workflow for hyperfine:
# https://github.com/sharkdp/hyperfine/blob/24a0d5da1bff11567bbf307315d11cb0e10733ec/.github/workflows/CICD.yml
build_release:
if: ${{ inputs.release }}
needs: test
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
matrix:
job:
- { target: aarch64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
- { target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true }
- { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, use-cross: true }
- { target: i686-pc-windows-msvc , os: windows-2019 }
- { target: i686-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
- { target: i686-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
- { target: x86_64-apple-darwin , os: macos-12 }
- { target: x86_64-pc-windows-msvc , os: windows-2019 }
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
- { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
env:
BUILD_CMD: cargo
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Install prerequisites
shell: bash
run: |
case ${{ matrix.job.target }} in
arm-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
esac
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.job.target }}

- name: Install cross
if: matrix.job.use-cross
uses: taiki-e/install-action@v2
with:
tool: cross

- name: Overwrite build command env variable
if: matrix.job.use-cross
shell: bash
run: echo "BUILD_CMD=cross" >> $GITHUB_ENV

- name: Show version information (Rust, cargo, GCC)
shell: bash
run: |
gcc --version || true
rustup -V
rustup toolchain list
rustup default
cargo -V
rustc -V
- name: Build
shell: bash
run: $BUILD_CMD build --locked --release --target=${{ matrix.job.target }}

- name: Set binary name & path
id: bin
shell: bash
run: |
# Figure out suffix of binary
EXE_suffix=""
case ${{ matrix.job.target }} in
*-pc-windows-*) EXE_suffix=".exe" ;;
esac;
# Setup paths
BIN_NAME="fungus${EXE_suffix}"
BIN_PATH="target/${{ matrix.job.target }}/release/${BIN_NAME}"
# Let subsequent steps know where to find the binary
echo "BIN_PATH=${BIN_PATH}" >> $GITHUB_OUTPUT
echo "BIN_NAME=${BIN_NAME}" >> $GITHUB_OUTPUT
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: fungus-${{ matrix.job.target }}
path: ${{ steps.bin.outputs.BIN_PATH }}
if-no-files-found: error
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
[package]
name = "manual-analyzer"
name = "fungus-cli"
version = "1.0.0"
authors = ["Gabriel Lacroix", "Kirollos Roufail", "Louis Hildebrand"]
edition = "2021"
description = "FUNGUS is a tool for detecting similarities between ARMv7 assembly projects, for example, for introductory software assignments."
readme = "README.md"
homepage = "https://github.com/Project-Fungus"
repository = "https://github.com/Project-Fungus/fungus-cli"
license = "MIT"
keywords = ["plagiarism", "copy_detection", "assignments"]
categories = ["command-line-utilities"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ FUNGUS is a tool for detecting similarities between ARMv7 assembly projects, for

FUNGUS is inspired by Stanford's [Measure of Software Similarity](https://theory.stanford.edu/~aiken/moss/) (Moss). At its core, it uses the same algorithm, winnowing, described in [this paper](https://theory.stanford.edu/~aiken/publications/papers/sigmod03.pdf).

## Installation

### Binary

1. Go to the [Releases page](https://github.com/Project-Fungus/fungus-cli/releases).
2. Download the artifact for your platform.
3. Add the command to your `PATH`.

Run `fungus --version` to check that the installation was successful.

### Building From Source

1. Clone this repository or download the code.
2. Ensure you have [installed Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html).
3. Run `cargo build --release`. The binary will be placed in the `target/release/` directory.

## Key Inputs

### Root
Expand Down
2 changes: 1 addition & 1 deletion src/identity_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//!
//! ```rust
//! # fn main() {
//! use manual_analyzer::identity_hash::{IdentityHashMap, IdentityHashSet};
//! use fungus_cli::identity_hash::{IdentityHashMap, IdentityHashSet};
//! let mut map: IdentityHashMap<u32> = IdentityHashMap::default();
//! map.insert(22, 44);
//! let mut set: IdentityHashSet = IdentityHashSet::default();
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
};
use walkdir::WalkDir;

use manual_analyzer::{
use fungus_cli::{
detect_plagiarism,
lexing::TokenizingStrategy,
output::{Output, Warning, WarningType},
Expand Down

0 comments on commit a971ac7

Please sign in to comment.