Skip to content

Commit

Permalink
Merge pull request #129 from duduainankai/add-format-check-ci
Browse files Browse the repository at this point in the history
Add format check ci
  • Loading branch information
utam0k authored Jul 11, 2021
2 parents 5633ff8 + f8b08c0 commit d87020c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ on:
- main

jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: rustup component add rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
tests:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions oci_spec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::HashMap;
use std::fs::File;
use std::path::{Path, PathBuf};

use anyhow::{Context, Result, bail};
use anyhow::{bail, Context, Result};
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone)]
Expand Down Expand Up @@ -616,7 +616,7 @@ impl Spec {

pub fn canonicalize_rootfs(&mut self) -> Result<()> {
self.root.path = std::fs::canonicalize(&self.root.path)
.with_context(|| format!("failed to canonicalize {:?}", self.root.path))?;
.with_context(|| format!("failed to canonicalize {:?}", self.root.path))?;
Ok(())
}
}
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use youki::rootless::should_use_rootless;
use youki::start;
use youki::state;


/// High-level commandline option definition
/// This takes global options as well as individual commands as specified in [OCI runtime-spec](https://github.com/opencontainers/runtime-spec/blob/master/runtime.md)
/// Also check [runc commandline documentation](https://github.com/opencontainers/runc/blob/master/man/runc.8.md) for more explanation
Expand Down

0 comments on commit d87020c

Please sign in to comment.