Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.0.8 #87

Merged
merged 7 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .cargo/config.toml

This file was deleted.

7 changes: 6 additions & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: πŸ§ͺ Audit
on:
push:
branches:
- main
- feat/hsh
pull_request:
branches:
Expand All @@ -18,6 +19,10 @@ jobs:
- uses: hecrj/setup-rust-action@v2
- name: Install cargo-audit
run: cargo install cargo-audit

- uses: actions/checkout@v4
- name: Audit dependencies
- name: Resolve dependencies
run: cargo update

- name: Audit vulnerabilities
run: cargo audit
1 change: 1 addition & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: πŸ§ͺ Check
on:
push:
branches:
- main
- feat/hsh
pull_request:
branches:
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: πŸ“Ά Coverage

on:
push:
branches:
- main
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4

# Setup Rust nightly
- name: Install Rust
uses: actions-rs/toolchain@v1
id: toolchain
with:
toolchain: nightly
override: true

# Configure cache for Cargo
- name: Cache Cargo registry, index
uses: actions/cache@v4
id: cache-cargo
with:
path: |
~/.cargo/registry
~/.cargo/bin
~/.cargo/git
key: linux-${{ steps.toolchain.outputs.rustc_hash }}-rust-cov-${{ hashFiles('**/Cargo.lock') }}

# Run tests with all features
- name: Test (cargo test)
uses: actions-rs/cargo@v1
with:
command: test
args: "--workspace"

# Install grcov
- uses: actions-rs/grcov@v0.1
id: coverage

# Upload to Codecov.io
- name: Upload to Codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{ steps.coverage.outputs.report }}
17 changes: 8 additions & 9 deletions .github/workflows/document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: πŸ§ͺ Document
on:
push:
branches:
- feat/hsh
- main
pull_request:
branches:
- feat/hsh
- main
release:
types: [created]

Expand Down Expand Up @@ -45,16 +45,15 @@ jobs:
retention-days: 1

- name: Write CNAME file
run: echo 'doc.hshlib.one' > ./target/doc/CNAME
run: echo 'doc.hshlib.com' > ./target/doc/CNAME

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
publish_branch: gh-pages
cname: true
clean: true
commit_message: Deploy documentation at ${{ github.sha }}
commit_user_name: github-actions
commit_user_email: actions@users.noreply.github.com
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./target/doc
user_email: actions@users.noreply.github.com
user_name: github-actions
126 changes: 18 additions & 108 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: πŸ§ͺ Release

on: [push, pull_request]
on:
push:
branches:
- main
- feat/hsh
pull_request:
branches:
- feat/hsh
release:
types: [created]

concurrency:
group: ${{ github.ref }}
Expand All @@ -21,114 +30,25 @@ jobs:
BUILD_ID: ${{ github.run_id }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OS: ${{ matrix.os }}
TARGET: ${{ matrix.target }}
OS: ${{ matrix.platform.os }}
TARGET: ${{ matrix.platform.target }}

strategy:
fail-fast: false
matrix:
target:
# List of targets:
# https://doc.rust-lang.org/nightly/rustc/platform-support.html

# Tier 1 platforms πŸ†
- aarch64-unknown-linux-gnu # 64-bit Linux systems on ARM architecture
- i686-pc-windows-gnu # 32-bit Windows (i686-pc-windows-gnu)
- i686-pc-windows-msvc # 32-bit Windows (i686-pc-windows-msvc)
- i686-unknown-linux-gnu # 32-bit Linux (kernel 3.2+, glibc 2.17+)
- x86_64-apple-darwin # 64-bit macOS (10.7 Lion or later)
- x86_64-pc-windows-gnu # 64-bit Windows (x86_64-pc-windows-gnu)
- x86_64-pc-windows-msvc # 64-bit Windows (x86_64-pc-windows-msvc)
- x86_64-unknown-linux-gnu # 64-bit Linux (kernel 2.6.32+, glibc 2.11+)

# Tier 2 platforms πŸ₯ˆ
- aarch64-apple-darwin # 64-bit macOS on Apple Silicon
- aarch64-pc-windows-msvc # 64-bit Windows (aarch64-pc-windows-msvc)
- aarch64-unknown-linux-musl # 64-bit Linux systems on ARM architecture
- arm-unknown-linux-gnueabi # ARMv6 Linux (kernel 3.2, glibc 2.17)
- arm-unknown-linux-gnueabihf # ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17)
- armv7-unknown-linux-gnueabihf # ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17)
- powerpc-unknown-linux-gnu # PowerPC Linux (kernel 3.2, glibc 2.17)
- powerpc64-unknown-linux-gnu # PowerPC64 Linux (kernel 3.2, glibc 2.17)
- powerpc64le-unknown-linux-gnu # PowerPC64le Linux (kernel 3.2, glibc 2.17)
- riscv64gc-unknown-linux-gnu # RISC-V Linux (kernel 3.2, glibc 2.17)
- s390x-unknown-linux-gnu # s390x Linux (kernel 3.2, glibc 2.17)
- x86_64-unknown-freebsd # 64-bit FreeBSD on x86-64
- x86_64-unknown-linux-musl # 64-bit Linux (kernel 2.6.32+, musl libc)
- x86_64-unknown-netbsd # 64-bit NetBSD on x86-64

include:
# Tier 1 platforms πŸ†
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
cross: true
- target: i686-pc-windows-gnu
os: ubuntu-latest
cross: true
- target: i686-pc-windows-msvc
platform:
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: aarch64-pc-windows-msvc
os: windows-latest
cross: true
- target: i686-unknown-linux-gnu
os: ubuntu-latest
cross: true
- target: x86_64-apple-darwin
os: macos-latest
cross: true
- target: x86_64-pc-windows-gnu
os: ubuntu-latest
cross: true
- target: x86_64-pc-windows-msvc
os: windows-latest
cross: true
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
cross: true

# Tier 2 platforms πŸ₯ˆ
- target: aarch64-apple-darwin
os: macos-latest
cross: true
- target: aarch64-pc-windows-msvc
os: windows-latest
cross: true
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
cross: true
- target: arm-unknown-linux-gnueabi
os: ubuntu-latest
cross: true
- target: arm-unknown-linux-gnueabihf
os: ubuntu-latest
cross: true
- target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
cross: true
- target: powerpc-unknown-linux-gnu
os: ubuntu-latest
cross: true
- target: powerpc64-unknown-linux-gnu
os: ubuntu-latest
cross: true
- target: powerpc64le-unknown-linux-gnu
os: ubuntu-latest
cross: true
- target: riscv64gc-unknown-linux-gnu
os: ubuntu-latest
cross: true
- target: s390x-unknown-linux-gnu
os: ubuntu-latest
cross: true
- target: x86_64-unknown-freebsd
os: ubuntu-latest
cross: true
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
cross: true
- target: x86_64-unknown-netbsd
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
cross: true

runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.platform.os }}

steps:
# Check out the repository code.
Expand Down Expand Up @@ -158,21 +78,11 @@ jobs:
id: install-target
run: rustup target add ${{ env.TARGET }}

- name: Install Cross and clean artifacts
run: |
# Install cross
cargo install cross

# Clean the build artifacts
cargo clean --verbose
shell: bash

# Build the targets
- name: Build targets
id: build-targets
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --verbose --workspace --release --target ${{ env.TARGET }}

Expand Down
31 changes: 1 addition & 30 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,4 @@ jobs:
# Run tests with all features
- name: Run tests with all features
id: run-tests-all-features
run: cargo test --verbose --workspace --all-features

# Install grcov
- name: Install grcov
# Only run this job on the main branch when a commit is pushed.
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
id: install-grcov
run: |
mkdir -p "${HOME}/.local/bin"
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.18/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - -C "${HOME}/.local/bin"
echo "$HOME/.local/bin" >> $GITHUB_PATH

# Use grcov to generate a coverage report
- name: Generate coverage report
# Only run this job on the main branch when a commit is pushed.
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
id: generate-code-coverage
uses: actions-rs/cargo@v1.0.1
with:
command: xtask
args: coverage

# Upload the coverage report to codecov
- name: Upload coverage report to codecov
# Only run this job on the main branch when a commit is pushed.
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
id: upload-report-codecov
uses: codecov/codecov-action@v4
with:
files: coverage/*.lcov
run: cargo test --verbose --workspace --all-features
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ build
Icon?
src/.DS_Store
tarpaulin-report.html
Cargo.lock
Loading
Loading