From a5c5abb06fc9073722a18dd928480841ac7db7f8 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 13 Oct 2020 10:10:47 +0700 Subject: [PATCH 1/5] Remove unneeded "super" prefix --- dirs-sys/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dirs-sys/src/lib.rs b/dirs-sys/src/lib.rs index d1d41b8..500bde5 100644 --- a/dirs-sys/src/lib.rs +++ b/dirs-sys/src/lib.rs @@ -68,7 +68,7 @@ mod target_redox { use std::path::PathBuf; - use super::redox_users::{All, AllUsers, Config}; + use redox_users::{All, AllUsers, Config}; pub fn home_dir() -> Option { let current_uid = redox_users::get_uid().ok()?; From 997245d11f62824ae781fc3b323fb8e11d4540b0 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 13 Oct 2020 10:10:16 +0700 Subject: [PATCH 2/5] Add CI checks for redox OS --- .github/workflows/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5544f8e..220153b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,6 +26,17 @@ jobs: - run: cargo build --all-targets --workspace - run: cargo test --all-targets --workspace + redox_check: + runs-on: ubuntu-latest + env: + RUST_BACKTRACE: 1 + steps: + - uses: actions/checkout@v2 + - run: | + rustup default nightly + rustup target add x86_64-unknown-redox + - run: cargo check --all-targets --workspace --target x86_64-unknown-redox + rustfmt: runs-on: ubuntu-latest steps: From 653ceaa696b18f0338963c3c6c41e3d31c070d5f Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 13 Oct 2020 10:26:28 +0700 Subject: [PATCH 3/5] Use only one job for MSRV and clippy --- .github/workflows/main.yml | 41 +++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 220153b..dca7bae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,24 +45,41 @@ jobs: - run: cargo fmt -- --check minimum-rust-version: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - run: | rustup toolchain install 1.34.0 rustup default 1.34.0 - - run: cargo build --all-targets --all + rustup target add \ + x86_64-pc-windows-gnu \ + x86_64-apple-darwin \ + x86_64-pc-windows-msvc + - run: | + for target in x86_64-pc-windows-gnu x86_64-apple-darwin x86_64-pc-windows-msvc; do + echo "== checking $target ==" + cargo check --all-targets --all --target "$target" + done + shell: bash clippy: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: rustup component add clippy - # FIXME: Remove `-- -A clippy::option_as_ref_deref` when MSRV is bumped past 1.40.0 - - run: cargo clippy --all --all-targets -- -A clippy::option_as_ref_deref + - run: | + rustup component add clippy + rustup target add \ + x86_64-pc-windows-gnu \ + x86_64-apple-darwin \ + x86_64-pc-windows-msvc + - run: | + for target in x86_64-pc-windows-gnu x86_64-apple-darwin x86_64-pc-windows-msvc; do + echo "== checking $target ==" + cargo check --all-targets --all --target "$target" + git ls-files '*lib.rs' | xargs touch + # FIXME: Remove `-- -A clippy::option_as_ref_deref` when MSRV is bumped past 1.40.0 + cargo clippy --all-targets --all --target "$target" \ + -- \ + -A clippy::option_as_ref_deref + done + shell: bash From 3a37e118836c06f81488aea2a259e4db0e60b0bb Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 13 Oct 2020 10:58:27 +0700 Subject: [PATCH 4/5] Allow clippy::redundant_field_names lint --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dca7bae..b7be1d6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -80,6 +80,7 @@ jobs: # FIXME: Remove `-- -A clippy::option_as_ref_deref` when MSRV is bumped past 1.40.0 cargo clippy --all-targets --all --target "$target" \ -- \ - -A clippy::option_as_ref_deref + -A clippy::option_as_ref_deref \ + -A clippy::redundant_field_names done shell: bash From eb791d557050df407f18421a0e1afbcf1f0cadd4 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 13 Oct 2020 11:13:00 +0700 Subject: [PATCH 5/5] More exact checks for bors --- .github/workflows/main.yml | 22 ++++++++++++++++++++++ bors.toml | 9 +-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b7be1d6..22e553c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,3 +84,25 @@ jobs: -A clippy::redundant_field_names done shell: bash + + # These jobs doesn't actually test anything, but they're only used to tell + # bors the build completed, as there is no practical way to detect when a + # workflow is successful listening to webhooks only. + # + # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! + end-success: + name: bors build finished + runs-on: ubuntu-latest + needs: [build] + if: github.event.pusher.name == 'bors' && success() + steps: + - name: mark the job as a success + run: exit 0 + end-failure: + name: bors build finished + runs-on: ubuntu-latest + needs: [build] + if: github.event.pusher.name == 'bors' && (failure() || cancelled()) + steps: + - name: mark the job as a failure + run: exit 1 diff --git a/bors.toml b/bors.toml index bdca237..444af25 100644 --- a/bors.toml +++ b/bors.toml @@ -1,11 +1,4 @@ -status = [ - "build (ubuntu-latest)", - "build (windows-latest)", - "build (macos-latest)", - "minimum-rust-version (ubuntu-latest)", - "minimum-rust-version (windows-latest)", - "minimum-rust-version (macos-latest)", -] +status = ["bors build finished"] # Default timeout is one hour timeout_sec = 600