diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4e30578 --- /dev/null +++ b/.github/dependabot.yml @@ -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" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7ea9c13 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/security-audit.yml b/.github/workflows/security-audit.yml new file mode 100644 index 0000000..59e988e --- /dev/null +++ b/.github/workflows/security-audit.yml @@ -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 }} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d3a2e70 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md index 600507e..5bcb605 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # SimConnect SDK in Rust +[![CI][ci_badge]][ci] + ## Usage ```toml @@ -71,4 +73,6 @@ fn main() -> Result<(), Box> { 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 diff --git a/simconnect-sdk-derive/src/lib.rs b/simconnect-sdk-derive/src/lib.rs index df0c0d7..ac072a2 100644 --- a/simconnect-sdk-derive/src/lib.rs +++ b/simconnect-sdk-derive/src/lib.rs @@ -70,8 +70,9 @@ const SUPPORTED_FIELD_TYPES: [&str; 2] = ["f64", "bool"]; /// * `unit` - Required. The unit of the field. /// /// # Example +/// /// ```rust -/// use simconnect_sdk::SimConnectObject; +/// # use simconnect_sdk_derive::SimConnectObject; /// /// #[derive(Debug, Clone, SimConnectObject)] /// #[simconnect(period = "second")] diff --git a/simconnect-sdk/src/lib.rs b/simconnect-sdk/src/lib.rs index 69d81ee..881cd6e 100644 --- a/simconnect-sdk/src/lib.rs +++ b/simconnect-sdk/src/lib.rs @@ -8,7 +8,7 @@ //! simconnect-sdk = { version = "0.1", features = ["derive"] } //! ``` //! -//! ```no_run +//! ```rust,no_run //! use simconnect_sdk::{Notification, SimConnect, SimConnectObject}; //! //! /// A data structure that will be used to receive data from SimConnect. diff --git a/simconnect-sdk/src/simconnect/base.rs b/simconnect-sdk/src/simconnect/base.rs index 4092f19..a242749 100644 --- a/simconnect-sdk/src/simconnect/base.rs +++ b/simconnect-sdk/src/simconnect/base.rs @@ -9,7 +9,7 @@ use crate::{ /// /// # Example /// -/// ```no_run +/// ```rust,no_run /// use simconnect_sdk::{Notification, SimConnect, SimConnectObject}; /// /// /// A data structure that will be used to receive data from SimConnect.