-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tim Evans
committed
Oct 25, 2023
1 parent
631cb65
commit ba62065
Showing
147 changed files
with
28,712 additions
and
0 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,33 @@ | ||
# Audit dependencies against the RustSec Advisory DB (https://rustsec.org/advisories/) | ||
name: Audit | ||
|
||
on: | ||
push: | ||
paths: | ||
# Run if workflow changes | ||
- '.github/workflows/audit.yml' | ||
# Run on changed dependencies | ||
- '**/Cargo.toml' | ||
- '**/Cargo.lock' | ||
# Run if the configuration file changes | ||
- '**/audit.toml' | ||
# Rerun periodicly to pick up new advisories | ||
schedule: | ||
- cron: '0 0 * * *' | ||
# Run manually | ||
workflow_dispatch: | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
audit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Audit Rust Dependencies | ||
uses: actions-rust-lang/audit@v1 | ||
with: | ||
denyWarnings: true | ||
createIssues: false |
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,72 @@ | ||
name: CI | ||
|
||
on: [push] | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
RUST_BACKTRACE: 1 | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
components: rustfmt | ||
|
||
- name: Check | ||
run: cargo check --all | ||
|
||
- name: Check featuresless | ||
run: cargo check --all --no-default-features | ||
|
||
- name: Clippy | ||
run: cargo clippy --all | ||
|
||
- name: Format | ||
uses: actions-rust-lang/rustfmt@v1 | ||
|
||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- { rust: stable, os: ubuntu-latest } | ||
- { rust: stable, os: windows-latest } | ||
- { rust: stable, os: macos-latest } | ||
- { rust: beta, os: ubuntu-latest } | ||
# Turn this on once we have a MSRV (minimum supported rust version) | ||
# - { rust: 1.70.0, os: ubuntu-latest } | ||
name: Test Rust ${{ matrix.rust }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
|
||
- name: Test | ||
run: cargo test --all | ||
|
||
- name: Build | ||
run: cargo build --all --release | ||
|
||
- name: C Examples | ||
if: runner.os != 'Windows' | ||
working-directory: ./omf-c/examples | ||
run: bash ./build.sh | ||
|
||
- name: C Examples (Windows) | ||
if: runner.os == 'Windows' | ||
working-directory: ./omf-c/examples | ||
run: ./build.bat |
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,51 @@ | ||
name: Docs | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
|
||
- name: Build docs | ||
run: | | ||
cd docs | ||
sh build.sh | ||
- name: Fix permissions | ||
run: | | ||
chmod -c -R +rX "./site/" | while read line; do | ||
echo "::warning title=Invalid file permissions automatically fixed::$line" | ||
done | ||
- name: Store artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: site/ | ||
|
||
# deploy: | ||
# needs: docs | ||
# environment: | ||
# name: github-pages | ||
# url: ${{ steps.deployment.outputs.page_url }} | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Deploy to pages | ||
# id: deployment | ||
# uses: actions/deploy-pages@v2 |
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 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
target/ | ||
|
||
# Generated by CMake. | ||
omf-c/examples/build/ | ||
|
||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries | ||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html | ||
Cargo.lock | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb | ||
|
||
# Generated code. | ||
/site/ | ||
/docs/schema/ | ||
/docs/parquet/ | ||
|
||
# Virtual environment for mkdocs | ||
/venv/ |
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,14 @@ | ||
{ | ||
"cSpell.language": "en", | ||
"cSpell.words": [ | ||
"colormap", | ||
"colormaps", | ||
"grayscale", | ||
"octree", | ||
"RGBA", | ||
"struct", | ||
"structs", | ||
"subblock" | ||
], | ||
"cmake.configureOnOpen": false | ||
} |
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,48 @@ | ||
[package] | ||
name = "omf" | ||
version = "0.1.0-alpha.2" | ||
description = "File reader and writer for Open Mining Format." | ||
authors = ["Tim Evans <[email protected]>"] | ||
license = "MIT" | ||
edition = "2021" | ||
publish = true | ||
exclude = ["/.github", "/.vscode"] | ||
|
||
[dependencies] | ||
bytes = { workspace = true, optional = true } | ||
chrono.workspace = true | ||
flate2.workspace = true | ||
image = { workspace = true, optional = true } | ||
parquet = { workspace = true, optional = true } | ||
schemars.workspace = true | ||
serde.workspace = true | ||
serde_json.workspace = true | ||
thiserror.workspace = true | ||
zip.workspace = true | ||
|
||
[dev-dependencies] | ||
bytes.workspace = true | ||
regex.workspace = true | ||
|
||
[features] | ||
default = ["image", "parquet", "omf1"] | ||
image = ["dep:image"] | ||
parquet = ["dep:parquet", "dep:bytes"] | ||
omf1 = ["parquet"] | ||
|
||
[workspace] | ||
members = ["omf-c"] | ||
|
||
[workspace.dependencies] | ||
bytes = "1.4.0" | ||
cbindgen = { version = "0.24.5", default-features = false } | ||
chrono = { version = "0.4.30", default-features = false, features = ["serde"] } | ||
flate2 = "1.0.27" | ||
image = { version = "0.24.7", default-features = false, features = ["png", "jpeg"] } | ||
parquet = { version = "46.0.0", default-features = false, features = ["flate2"] } | ||
regex = "1.9.3" | ||
schemars = { version = "0.8.12", features = ["chrono"] } | ||
serde = { version = "1.0.188", features = ["derive"] } | ||
serde_json = { version = "1.0.107", features = ["float_roundtrip"] } | ||
thiserror = "1.0.47" | ||
zip = { version = "0.6.6", default-features = false } |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@echo off | ||
python -m pip install -r requirements.txt || exit /b | ||
cd .. | ||
cargo test -p omf --lib -- --ignored update_schema_docs || exit /b | ||
cargo doc --no-deps || exit /b | ||
python -m mkdocs build || exit /b | ||
mv ./target/doc ./site/rust || exit /b | ||
rm ./site/rust/.lock || exit /b |
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,9 @@ | ||
#!/usr/bin/sh | ||
set -e | ||
python -m pip install -r requirements.txt | ||
cd .. | ||
cargo test -p omf --lib -- --ignored update_schema_docs | ||
cargo doc --no-deps | ||
python -m mkdocs build | ||
mv ./target/doc ./site/rust | ||
rm ./site/rust/.lock |
Oops, something went wrong.