Skip to content

Commit

Permalink
Merge pull request #3 from Brickworks/revisiting-in-2024
Browse files Browse the repository at this point in the history
add docs deploy
  • Loading branch information
philiplinden authored Feb 17, 2024
2 parents 027301f + ca8be9e commit 95e6b62
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 29 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
@@ -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'
23 changes: 0 additions & 23 deletions .github/workflows/rust.yml

This file was deleted.

3 changes: 2 additions & 1 deletion src/simulator/balloon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// Properties, attributes and functions related to the balloon.
// ----------------------------------------------------------------------------

#![allow(dead_code)]

extern crate libm;

use log::debug;
Expand Down Expand Up @@ -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,
};
Expand Down
8 changes: 5 additions & 3 deletions src/simulator/payload.rs → src/simulator/bus.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/simulator/forces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/simulator/gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/simulator/heat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/simulator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mod constants;
mod forces;
mod gas;
mod heat;
mod payload;
mod bus;

use log::{debug, error, info, warn};
use std::{
Expand Down Expand Up @@ -126,7 +126,7 @@ impl AsyncSim {

fn run_sim(
config: Config,
command_channel: Receiver<SimCommands>,
_command_channel: Receiver<SimCommands>,
sim_output: Arc<Mutex<SimOutput>>,
outpath: PathBuf,
) {
Expand Down

0 comments on commit 95e6b62

Please sign in to comment.