diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5544f8e..fed2e00 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: @@ -34,24 +45,64 @@ 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 \ + -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, redox_check, rustfmt, minimum-rust-version] + if: github.actor == 'bors[bot]' && success() + steps: + - name: mark the job as a success + run: exit 0 + end-failure: + name: bors build finished + runs-on: ubuntu-latest + needs: [build, redox_check, rustfmt, minimum-rust-version] + if: github.actor == 'bors[bot]' && (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 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()?;