diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 000000000..3efe07c96 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,37 @@ +name: Rust + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always + +jobs: + check-style: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Report rustfmt version + run: cargo fmt -- --version + - name: Check style + run: cargo fmt -- --check + build-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@nightly + - name: Test build documentation + run: cargo doc + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@nightly + - name: Build + run: cargo build --verbose + - name: Test + run: cargo test --verbose + diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 000000000..271fdf1c9 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,7 @@ +[workspace] + +members = [ + "propolis", + "propolis-cli", + "propolis-server", +] diff --git a/propolis-server/src/main.rs b/propolis-server/src/main.rs index 6f0e58342..29f47f505 100644 --- a/propolis-server/src/main.rs +++ b/propolis-server/src/main.rs @@ -118,13 +118,14 @@ async fn instance_ensure( // Create the instance. let lowmem = (properties.memory * 1024 * 1024) as usize; - let instance = build_instance(&properties.id.to_string(), properties.vcpus, lowmem) - .map_err(|err| { - HttpError::for_internal_error(format!( - "Cannot build instance: {}", - err.to_string() - )) - })?; + let instance = + build_instance(&properties.id.to_string(), properties.vcpus, lowmem) + .map_err(|err| { + HttpError::for_internal_error(format!( + "Cannot build instance: {}", + err.to_string() + )) + })?; // Initialize (some) of the instance's hardware. //