Add CI
This commit is contained in:
11
.github/dependabot.yml
vendored
Normal file
11
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
|
# package ecosystems to update and where the package manifests are located.
|
||||||
|
# Please see the documentation for all configuration options:
|
||||||
|
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "cargo" # See documentation for possible values
|
||||||
|
directory: "/" # Location of package manifests
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
30
.github/workflows/ci.yml
vendored
Normal file
30
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
checks:
|
||||||
|
name: Rust checks
|
||||||
|
runs-on: windows-2022
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
- uses: davidB/rust-cargo-make@v1
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Run format
|
||||||
|
run: cargo make format
|
||||||
|
- name: Run check
|
||||||
|
run: cargo make check
|
||||||
|
- name: Run clippy
|
||||||
|
run: cargo make clippy
|
||||||
|
- name: Run test
|
||||||
|
run: cargo make test
|
30
.github/workflows/security-audit.yml
vendored
Normal file
30
.github/workflows/security-audit.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
name: Security
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- "**/Cargo.toml"
|
||||||
|
- "**/Cargo.lock"
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- "**/Cargo.toml"
|
||||||
|
- "**/Cargo.lock"
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * *"
|
||||||
|
jobs:
|
||||||
|
security_audit:
|
||||||
|
name: Audit
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
- uses: actions-rs/audit-check@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2022 Mihai Dinculescu
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
@@ -1,5 +1,7 @@
|
|||||||
# SimConnect SDK in Rust
|
# SimConnect SDK in Rust
|
||||||
|
|
||||||
|
[![CI][ci_badge]][ci]
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
@@ -71,4 +73,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
See [more examples][examples].
|
See [more examples][examples].
|
||||||
|
|
||||||
|
[ci_badge]: https://github.com/mihai-dinculescu/simconnect-sdk/workflows/CI/badge.svg?branch=main
|
||||||
|
[ci]: https://github.com/mihai-dinculescu/simconnect-sdk/actions
|
||||||
[examples]: https://github.com/mihai-dinculescu/simconnect-sdk/tree/main/examples
|
[examples]: https://github.com/mihai-dinculescu/simconnect-sdk/tree/main/examples
|
||||||
|
@@ -70,8 +70,9 @@ const SUPPORTED_FIELD_TYPES: [&str; 2] = ["f64", "bool"];
|
|||||||
/// * `unit` - Required. The unit of the field.
|
/// * `unit` - Required. The unit of the field.
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// use simconnect_sdk::SimConnectObject;
|
/// # use simconnect_sdk_derive::SimConnectObject;
|
||||||
///
|
///
|
||||||
/// #[derive(Debug, Clone, SimConnectObject)]
|
/// #[derive(Debug, Clone, SimConnectObject)]
|
||||||
/// #[simconnect(period = "second")]
|
/// #[simconnect(period = "second")]
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
//! simconnect-sdk = { version = "0.1", features = ["derive"] }
|
//! simconnect-sdk = { version = "0.1", features = ["derive"] }
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! ```no_run
|
//! ```rust,no_run
|
||||||
//! use simconnect_sdk::{Notification, SimConnect, SimConnectObject};
|
//! use simconnect_sdk::{Notification, SimConnect, SimConnectObject};
|
||||||
//!
|
//!
|
||||||
//! /// A data structure that will be used to receive data from SimConnect.
|
//! /// A data structure that will be used to receive data from SimConnect.
|
||||||
|
@@ -9,7 +9,7 @@ use crate::{
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```rust,no_run
|
||||||
/// use simconnect_sdk::{Notification, SimConnect, SimConnectObject};
|
/// use simconnect_sdk::{Notification, SimConnect, SimConnectObject};
|
||||||
///
|
///
|
||||||
/// /// A data structure that will be used to receive data from SimConnect.
|
/// /// A data structure that will be used to receive data from SimConnect.
|
||||||
|
Reference in New Issue
Block a user