Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit a824e98

Browse files
committed
[chore] Update CI
1 parent 01ec54f commit a824e98

File tree

6 files changed

+65
-11
lines changed

6 files changed

+65
-11
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build & Check CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
ci:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
rust-toolchain: [nightly]
12+
targets: [x86_64-unknown-linux-gnu, x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat]
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: dtolnay/rust-toolchain@nightly
16+
with:
17+
toolchain: ${{ matrix.rust-toolchain }}
18+
components: rust-src, clippy, rustfmt
19+
targets: ${{ matrix.targets }}
20+
- name: Check rust version
21+
run: rustc --version --verbose
22+
- name: Check code format
23+
run: cargo fmt --all -- --check
24+
- name: Clippy
25+
run: cargo clippy --target ${{ matrix.targets }} --all-features -- -A clippy::new_without_default
26+
- name: Build
27+
run: cargo build --target ${{ matrix.targets }} --all-features
28+
- name: Unit test
29+
if: ${{ matrix.targets == 'x86_64-unknown-linux-gnu' }}
30+
run: cargo test --target ${{ matrix.targets }} -- --nocapture

.github/workflows/doc.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build & Deploy docs
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
doc:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
permissions:
11+
contents: write
12+
env:
13+
default-branch: ${{ format('refs/heads/{0}', github.event.repository.default_branch) }}
14+
RUSTDOCFLAGS: -D rustdoc::broken_intra_doc_links -D missing-docs
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: dtolnay/rust-toolchain@nightly
18+
- name: Build docs
19+
continue-on-error: ${{ github.ref != env.default-branch && github.event_name != 'pull_request' }}
20+
run: |
21+
cargo doc --no-deps --all-features
22+
printf '<meta http-equiv="refresh" content="0;url=%s/index.html">' $(cargo tree | head -1 | cut -d' ' -f1) > target/doc/index.html
23+
- name: Deploy to Github Pages
24+
if: ${{ github.ref == env.default-branch }}
25+
uses: JamesIves/github-pages-deploy-action@v4
26+
with:
27+
single-commit: true
28+
branch: gh-pages
29+
folder: target/doc

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ edition = "2021"
55
authors = ["Wedson Almeida Filho <wedsonaf@google.com>"]
66
description = "Linked lists that supports arbitrary removal in constant time"
77
license = "GPL-2.0-or-later"
8-
homepage = "https://github.com/rcore-os/arceos"
9-
repository = "https://github.com/rcore-os/arceos/tree/main/crates/linked_list"
10-
documentation = "https://rcore-os.github.io/arceos/linked_list/index.html"
8+
documentation = "https://Starry-OS.github.io/arceos/linked_list/index.html"
119
keywords = ["Starry"]
1210

1311
[dependencies]

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
mod linked_list;
1010
pub mod raw_list;
1111
pub use linked_list::{GetLinksWrapped, List, Wrapper};
12-
pub use raw_list::{GetLinks, Cursor, Links};
12+
pub use raw_list::{Cursor, GetLinks, Links};

src/linked_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern crate alloc;
1212
use alloc::{boxed::Box, sync::Arc};
1313
use core::ptr::NonNull;
1414

15-
use crate::{GetLinks, Links, Cursor, raw_list, raw_list::RawList};
15+
use crate::{raw_list, raw_list::RawList, Cursor, GetLinks, Links};
1616

1717
// TODO: Use the one from `kernel::file_operations::PointerWrapper` instead.
1818
/// Wraps an object to be inserted in a linked list.

src/raw_list.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
//! TODO: This module is a work in progress.
66
77
use core::{
8-
iter,
98
cell::UnsafeCell,
10-
ptr,
9+
iter, ptr,
1110
ptr::NonNull,
1211
sync::atomic::{AtomicBool, Ordering},
1312
};
@@ -94,7 +93,7 @@ pub(crate) struct RawList<G: GetLinks> {
9493
}
9594

9695
impl<G: GetLinks> RawList<G> {
97-
pub(crate) const fn new() -> Self {
96+
pub(crate) const fn new() -> Self {
9897
Self { head: None }
9998
}
10099

@@ -442,7 +441,6 @@ impl<G: GetLinks> iter::DoubleEndedIterator for Iterator<'_, G> {
442441
mod tests {
443442
extern crate alloc;
444443
use alloc::{boxed::Box, vec::Vec};
445-
use core::ptr::NonNull;
446444

447445
struct Example {
448446
links: super::Links<Self>,
@@ -527,7 +525,7 @@ mod tests {
527525
for n in 1..=MAX {
528526
// SAFETY: The entry was allocated above, it's not in any lists yet, is never moved,
529527
// and outlives the list.
530-
unsafe {list.push_back(&v[n - 1]) };
528+
unsafe { list.push_back(&v[n - 1]) };
531529
assert_list_contents(&v[..n], &list);
532530
}
533531
}
@@ -554,4 +552,3 @@ mod tests {
554552
});
555553
}
556554
}
557-

0 commit comments

Comments
 (0)