From c8eccd62372a33831149da73ae4adee0375e4121 Mon Sep 17 00:00:00 2001 From: Arne Beer Date: Sat, 3 Oct 2020 15:40:41 +0200 Subject: [PATCH 1/2] Add github action workflow check that enforces 'cargo fmt' --- .github/workflows/rust.yml | 5 ++++- src/process/mod.rs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e7a82572..71a36883 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -36,6 +36,9 @@ jobs: if: matrix.toolchain == '1.33.0' run: cargo +${{ matrix.toolchain }} doc + - name: Run cargo fmt + if: matrix.toolchain == 'stable' + run: cargo +${{ matrix.toolchain }} fmt -- --check android-check: strategy: @@ -70,4 +73,4 @@ jobs: # run: env RUST_BACKTRACE=1 cargo test --verbose --all # - name: Doc (1.33) - # run: cargo doc \ No newline at end of file + # run: cargo doc diff --git a/src/process/mod.rs b/src/process/mod.rs index 21009228..a2bf2242 100644 --- a/src/process/mod.rs +++ b/src/process/mod.rs @@ -58,10 +58,10 @@ use crate::from_iter; use std::ffi::OsString; use std::fs; use std::io::{self, Read}; -#[cfg(all(unix, not(target_os = "android")))] -use std::os::linux::fs::MetadataExt; #[cfg(target_os = "android")] use std::os::android::fs::MetadataExt; +#[cfg(all(unix, not(target_os = "android")))] +use std::os::linux::fs::MetadataExt; use std::path::PathBuf; use std::str::FromStr; From 688a4912838905b4cf94f901b7cfc8bd4cf06a73 Mon Sep 17 00:00:00 2001 From: Arne Beer Date: Sat, 3 Oct 2020 15:44:41 +0200 Subject: [PATCH 2/2] Run actions on PRs, master and new version --- .github/workflows/rust.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 71a36883..3715a65b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,8 +1,12 @@ name: Rust -on: [push] - - +on: + push: + branches: + - master + tags: + - 'v*.*.*' + pull_request: jobs: build: