-
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
0 parents
commit 9aab0bf
Showing
32 changed files
with
4,818 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,8 @@ | ||
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.166.1/containers/rust/.devcontainer/base.Dockerfile | ||
|
||
FROM mcr.microsoft.com/vscode/devcontainers/rust:0-1 | ||
|
||
# [Optional] Uncomment this section to install additional packages. | ||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install --no-install-recommends \ | ||
protobuf-compiler |
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,40 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.166.1/containers/rust | ||
{ | ||
"name": "Rust", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"lldb.executable": "/usr/bin/lldb", | ||
// VS Code don't watch files under ./target | ||
"files.watcherExclude": { | ||
"**/target/**": true | ||
} | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"rust-lang.rust", | ||
"bungcip.better-toml", | ||
"vadimcn.vscode-lldb", | ||
"mutantdino.resourcemonitor" | ||
], | ||
|
||
"mounts": [ | ||
"source=${localEnv:HOME}/.cargo/registry,target=/home/vscode/.cargo/registry,type=bind,consistency=cached" | ||
], | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "rustc --version", | ||
|
||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode" | ||
} |
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,6 @@ | ||
ignore-not-existing: true | ||
llvm: true | ||
output-type: lcov | ||
output-path: ./lcov.info | ||
ignore-dir: | ||
ignore: |
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,63 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ master, jacobsen/fsm_allow_one_side_attested ] | ||
pull_request: | ||
branches: [ master ] | ||
schedule: | ||
- cron: '0 0 1 * *' # trigger monthly | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
Build_and_Test: | ||
runs-on: self-hosted | ||
strategy: | ||
matrix: | ||
# Run on latest ubuntu and macos using latest stable and nightly toolchain | ||
os: [ubuntu-latest] #, macos-latest] | ||
rust: | ||
- stable | ||
- nightly | ||
- beta | ||
- 1.63.0 # Minimum supported rust version | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Linux Dependencies | ||
if: matrix.os == 'ubuntu-latest' | ||
run: sudo apt-get update -yq && sudo apt-get install -y protobuf-compiler && protoc --version | ||
|
||
- name: Install macOS Dependencies | ||
if: matrix.os == 'macos-latest' | ||
run: brew update && brew install protobuf && protoc --version | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{ matrix.rust }} | ||
override: true | ||
components: clippy, rustfmt | ||
|
||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --all-features --verbose | ||
|
||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all-features --verbose | ||
|
||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all-targets --all-features # -- -D warnings # TODO use "-D warnings" again when clippy issue is fixed: https://github.com/rust-lang/rust-clippy/issues/11179 | ||
|
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,49 @@ | ||
on: [push, pull_request] | ||
|
||
name: Code Coverage | ||
|
||
jobs: | ||
grcov: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
|
||
- name: Install Linux Dependencies | ||
run: sudo apt-get update -yq && sudo apt-get install -y protobuf-compiler && protoc --version | ||
|
||
- name: Run Tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all-features --no-fail-fast | ||
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' | ||
|
||
- name: Gather Coverage Data | ||
id: coverage | ||
uses: actions-rs/[email protected] | ||
|
||
- name: Coveralls Upload | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel: true | ||
path-to-lcov: lcov.info | ||
|
||
grcov_finalize: | ||
runs-on: ubuntu-latest | ||
needs: grcov | ||
steps: | ||
- name: Coveralls finalization | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel-finished: true |
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 @@ | ||
name: Dependency audit | ||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
jobs: | ||
audit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/audit-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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,4 @@ | ||
/target | ||
Cargo.lock | ||
.idea/workspace.xml | ||
idea/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,20 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug unit tests in library 'async-idscp2'", | ||
"cargo": { | ||
"args": [ | ||
"test", | ||
], | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
} | ||
] | ||
} |
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,7 @@ | ||
[workspace] | ||
members = [ | ||
"idscp2_core", | ||
] | ||
|
||
[profile.bench] | ||
debug = true |
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,2 @@ | ||
Für FSM: evtl match guards verwenden für nicht-statische werte in Match Expressions: https://doc.rust-lang.org/rust-by-example/flow_control/match/guard.html | ||
API design: an Rust Guidelines halten: https://rust-lang.github.io/api-guidelines/checklist.html |
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,10 @@ | ||
|
||
![Tests](https://github.com/obraunsdorf/async-idscp2/actions/workflows/ci.yml/badge.svg?branch=master) | ||
[![Coverage Status](https://coveralls.io/repos/github/obraunsdorf/async-idscp2/badge.svg?branch=master)](https://coveralls.io/github/obraunsdorf/async-idscp2?branch=master) | ||
|
||
# Async-Idscp2 | ||
|
||
The asynchronous implementation of the IDSCP2 protocol in Rust. | ||
|
||
# Notes | ||
Make sure the APIs follow the Rust Guidelines: https://rust-lang.github.io/api-guidelines/checklist.html |
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,35 @@ | ||
[package] | ||
name = "idscp2_core" | ||
version = "0.1.0" | ||
authors = [ | ||
"Oliver Braunsdorf <[email protected]>", | ||
"Leon Beckmann <[email protected]>" | ||
] | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
tinyvec = "1.6" | ||
thiserror = "1.0" | ||
log = "0.4" | ||
protobuf = { version = "2.27.1", features = ["with-bytes"] } | ||
bytes = "1.1" | ||
futures = "0.3" | ||
async-trait = "0.1.57" | ||
tokio = {version = "1.17", features = ["full"] } | ||
openssl = "0.10.41" | ||
|
||
[build-dependencies] | ||
protoc-rust = "2.27.1" | ||
|
||
[dev-dependencies] | ||
env_logger = "0.10.0" | ||
tokio-test = "0.4.2" | ||
rand = "^0.8.5" | ||
criterion = "=0.4.0" | ||
lazy_static = "1.4.0" | ||
|
||
[[bench]] | ||
name = "tokio_idscp_connection" | ||
harness = false |
Oops, something went wrong.