Skip to content
Draft
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
198 changes: 198 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
name: CI

on:
push:
branches:
- main
- "*.*"
pull_request:
branches:
- "*"
schedule:
- cron: "0 0 * * MON"

env:
CARGO_TERM_COLOR: always

jobs:
lock:
name: Cargo.lock
runs-on: ubuntu-latest

steps:
- name: Checkout the Repository
uses: actions/checkout@v2

- name: Install the Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true

- name: Generate the minimum version lockfile
run: |
cargo update -Z minimal-versions
cargo update -Z direct-minimal-versions
mv Cargo.lock Cargo.lock.min

- name: Generate the current version lockfile
run: cargo update

- name: Upload the Cargo lockfiles
uses: actions/upload-artifact@v4
with:
name: Cargo.lock
path: |
Cargo.lock
Cargo.lock.min

check:
name: Check
strategy:
matrix:
os: [ubuntu-latest]
rust: ["1.85", stable, nightly]
lock: ["Cargo.lock", "Cargo.lock.min"]
runs-on: ${{ matrix.os }}
needs: lock

steps:
- name: Checkout the Repository
uses: actions/checkout@v2
with:
submodules: true

- name: Install the Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true

- name: Install power tools
uses: taiki-e/install-action@cargo-hack

- name: Download the Cargo lockfiles
uses: actions/download-artifact@v4
with:
name: Cargo.lock

- name: Rename ${{ matrix.lock }} to Cargo.lock
run: mv ${{ matrix.lock }} Cargo.lock
if: ${{ matrix.lock != 'Cargo.lock' }}

- name: Check the powerset
run: |
cargo hack check --all \
--feature-powerset --keep-going

test:
name: Test Suite
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable]
lock: ["Cargo.lock", "Cargo.lock.min"]
runs-on: ${{ matrix.os }}
needs: lock

steps:
- name: Checkout the Repository
uses: actions/checkout@v2
with:
submodules: true

- name: Install the Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true

- name: Install power tools
uses: taiki-e/install-action@cargo-hack

- name: Download the Cargo lockfiles
uses: actions/download-artifact@v4
with:
name: Cargo.lock

- name: Rename ${{ matrix.lock }} to Cargo.lock
run: mv ${{ matrix.lock }} Cargo.lock
if: ${{ matrix.lock != 'Cargo.lock' }}

- name: Run the test-suite powerset
run: |
cargo hack test --workspace \
--no-fail-fast --feature-powerset --keep-going \
--release

fmt:
name: Rustfmt
runs-on: ubuntu-latest

steps:
- name: Checkout the Repository
uses: actions/checkout@v2

- name: Install the Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
override: true

- name: Check the code formatting
run: cargo fmt --all -- --check

clippy:
name: Clippy
strategy:
matrix:
os: [ubuntu-latest]
rust: ["1.85", stable]
lock: ["Cargo.lock", "Cargo.lock.min"]
runs-on: ${{ matrix.os }}
needs: lock

steps:
- name: Checkout the Repository
uses: actions/checkout@v2
with:
submodules: true

- name: Install the Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
components: clippy
override: true

- name: Install power tools
uses: taiki-e/install-action@cargo-hack

- name: Download the Cargo lockfiles
uses: actions/download-artifact@v4
with:
name: Cargo.lock

- name: Rename ${{ matrix.lock }} to Cargo.lock
run: mv ${{ matrix.lock }} Cargo.lock
if: ${{ matrix.lock != 'Cargo.lock' }}

- name: Check the code style powerset
if: ${{ matrix.rust == 'stable' && matrix.lock == 'Cargo.lock' }}
run: |
cargo hack clippy --all \
--feature-powerset --keep-going \
-- -D warnings

- name: Check the code style powerset
if: ${{ matrix.rust != 'stable' || matrix.lock != 'Cargo.lock' }}
run: |
cargo hack clippy --all \
--feature-powerset --keep-going \
-- -D warnings -A unknown-lints -A clippy::multiple-crate-versions
47 changes: 47 additions & 0 deletions .github/workflows/rustdoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: rustdoc to gh-pages

on:
push:
branches:
- main

env:
CARGO_TERM_COLOR: always

jobs:
release:
name: GitHub Pages
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout the Repository
uses: actions/checkout@v2
with:
submodules: true

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

- name: Build the Documentation
run: |
RUSTDOCFLAGS="\
--enable-index-page \
--generate-link-to-definition \
-Zunstable-options\
" cargo doc \
--all-features \
--no-deps \
--workspace

- name: Deploy the Documentation
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./target/doc
keep_files: false
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "libpressio-sys/libpressio"]
path = libpressio-sys/libpressio
url = https://github.com/robertu94/libpressio.git
[submodule "libpressio-sys/std_compat"]
path = libpressio-sys/std_compat
url = https://github.com/robertu94/std_compat
46 changes: 36 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,41 @@
[workspace]
resolver = "2"
members = ["libpressio-sys"]

[workspace.package]
edition = "2024"
authors = ["Robert Underwood <[email protected]>"]
repository = "https://github.com/robertu94/libpressio-rs"
rust-version = "1.85"

[workspace.dependencies]
# workspace-internal crates
libpressio = { version = "0.1", path = ".", default-features = false }
libpressio-sys = { version = "0.1", path = "libpressio-sys", default-features = false }

# crates.io third-party dependencies
bindgen = { version = "0.71", default-features = false }
cc = { version = "1.2", default-features = false }
cmake = { version = "0.1.26", default-features = false }
libc = { version = "0.2", default-features = false }
ndarray = { version = "0.16.1", default-features = false }

[package]
name = "libpressio-rs"
name = "libpressio"
version = "0.1.0"
authors = ["Robert Underwood <[email protected]>"]
edition = "2018"
edition = { workspace = true }
authors = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
description = "High-level Rust bindings to the libpressio compression framework"
categories = ["api-bindings", "compression", "encoding"]
keywords = ["libpressio", "compression", "encoding"]

[dependencies]
ndarray = "0.14.0"
libc = "0.2.86"
[features]
openmp = ["libpressio-sys/openmp"]

[build-dependencies]
bindgen = "0.53.1"
pkg-config = "0.3.19"
[dependencies]
ndarray = { workspace = true }
libc = { workspace = true }
libpressio-sys = { workspace = true }
29 changes: 0 additions & 29 deletions build.rs

This file was deleted.

23 changes: 23 additions & 0 deletions libpressio-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "libpressio-sys"
version = "0.1.0"
edition = { workspace = true }
authors = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }

description = "Low-level Rust bindings to the libpressio compression framework"
readme = "README.md"
categories = ["api-bindings", "compression", "encoding"]
keywords = ["libpressio", "bindgen", "compression", "encoding"]

[features]
# For now, enabling the `openmp` feature assumes that OpenMP is pre-installed
openmp = []

[build-dependencies]
anyhow = "1.0.98"
bindgen = { workspace = true, features = ["runtime"] }
cc = { workspace = true }
cmake = { workspace = true }
regex = "1.11.1"
Loading