Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI check for redox OS #37

Merged
merged 5 commits into from Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
75 changes: 63 additions & 12 deletions .github/workflows/main.yml
Expand Up @@ -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:
Expand All @@ -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
9 changes: 1 addition & 8 deletions 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
2 changes: 1 addition & 1 deletion dirs-sys/src/lib.rs
Expand Up @@ -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<PathBuf> {
let current_uid = redox_users::get_uid().ok()?;
Expand Down