diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml new file mode 100644 index 0000000..c59efbf --- /dev/null +++ b/.github/workflows/cargo.yml @@ -0,0 +1,111 @@ +name: Cargo + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + RUST_LOG: info + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Restore cargo cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry/index + ~/.cargo/registry/cache + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + - name: Cargo Check + run: cargo check + - name: Cargo Build + run: cargo build --release --all-features + test: + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Restore cargo cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry/index + ~/.cargo/registry/cache + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + doc: + runs-on: ubuntu-latest + needs: + - build + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Restore cargo cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry/index + ~/.cargo/registry/cache + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + - name: Cargo Doc + run: cargo doc --no-deps --target-dir=docs + - uses: actions/upload-artifact@v3 + with: + name: docs + path: docs + deploy: + if: github.ref == 'refs/heads/main' + needs: doc + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/download-artifact@v3 + with: + name: docs + path: docs + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v2 + with: + path: site + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 + if: github.event_name != 'pull_request' diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index 52a193c..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Rust - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - RUST_LOG: info - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose diff --git a/src/simulator/balloon.rs b/src/simulator/balloon.rs index 66972c2..2d68179 100644 --- a/src/simulator/balloon.rs +++ b/src/simulator/balloon.rs @@ -4,6 +4,8 @@ // Properties, attributes and functions related to the balloon. // ---------------------------------------------------------------------------- +#![allow(dead_code)] + extern crate libm; use log::debug; @@ -279,7 +281,6 @@ pub const RUBBER: Material = Material { specific_heat: 1490.0, poissons_ratio: 0.5, elasticity: 4_000_000.0, - // max_strain: 8.0, max_strain: 8.0, max_stress: 25_000_000.0, }; diff --git a/src/simulator/payload.rs b/src/simulator/bus.rs similarity index 74% rename from src/simulator/payload.rs rename to src/simulator/bus.rs index 57689ce..a741cf4 100644 --- a/src/simulator/payload.rs +++ b/src/simulator/bus.rs @@ -1,9 +1,11 @@ // ---------------------------------------------------------------------------- -// Payload -// ------- -// Properties and functions of the balloon's payload and avionics +// Bus +// --- +// Properties and functions of the balloon's structure and avionics busses // ---------------------------------------------------------------------------- +#![allow(dead_code)] + pub struct Bus { pub dry_mass: f32, // kg pub drag_coeff: f32, // drag coefficient during free fall diff --git a/src/simulator/forces.rs b/src/simulator/forces.rs index 5194b3c..fa11a98 100644 --- a/src/simulator/forces.rs +++ b/src/simulator/forces.rs @@ -4,6 +4,9 @@ // Forces that act in the vertical axis. All forces assume a positive-up // coordinate frame and aR_E R_Eported in Newtons. // ---------------------------------------------------------------------------- + +#![allow(dead_code)] + extern crate libm; use log::debug; diff --git a/src/simulator/gas.rs b/src/simulator/gas.rs index 19b1afa..9fcca57 100644 --- a/src/simulator/gas.rs +++ b/src/simulator/gas.rs @@ -16,6 +16,8 @@ // https://www.grc.nasa.gov/WWW/K-12/airplane/atmosmet.html // ---------------------------------------------------------------------------- +#![allow(dead_code)] + use super::constants::{R, STANDARD_PRESSURE, STANDARD_TEMPERATURE}; use log::error; use serde::Deserialize; diff --git a/src/simulator/heat.rs b/src/simulator/heat.rs index c076776..f82b24b 100644 --- a/src/simulator/heat.rs +++ b/src/simulator/heat.rs @@ -13,6 +13,9 @@ // https://materion.com/-/media/files/alloy/newsletters/technical-tidbits/issue-no-114-thermal-emissivity-and-radiative-heat-transfer.pdf // ---------------------------------------------------------------------------- +#![allow(dead_code)] +#![allow(unused_imports)] + use super::balloon::Balloon; use super::gas::Atmosphere; diff --git a/src/simulator/mod.rs b/src/simulator/mod.rs index ab336f6..9b785e0 100644 --- a/src/simulator/mod.rs +++ b/src/simulator/mod.rs @@ -4,7 +4,7 @@ mod constants; mod forces; mod gas; mod heat; -mod payload; +mod bus; use log::{debug, error, info, warn}; use std::{ @@ -126,7 +126,7 @@ impl AsyncSim { fn run_sim( config: Config, - command_channel: Receiver, + _command_channel: Receiver, sim_output: Arc>, outpath: PathBuf, ) {