-
Notifications
You must be signed in to change notification settings - Fork 5
update: add CI, Example, Test and ReadmeTag #2
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
base: main
Are you sure you want to change the base?
Changes from 14 commits
07a7d5a
ab477cf
414dc55
d4c4a1e
2e32b1c
2501b48
4b355ca
d75bf14
4d643de
0b53842
fe4ec78
75de54f
6a7b016
affb464
5621d79
1770ff1
d5a27fc
6070251
76c7e6f
3ea3b8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,41 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: [ main, master ] | ||
pull_request: | ||
branches: [ main, master ] | ||
|
||
workflow_dispatch: {} | ||
|
||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
rust-toolchain: [nightly] | ||
targets: [x86_64-unknown-linux-gnu, x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat] | ||
targets: [ x86_64-unknown-linux-gnu, x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat ] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
toolchain: ${{ matrix.rust-toolchain }} | ||
components: rust-src, clippy, rustfmt | ||
targets: ${{ matrix.targets }} | ||
- name: Check rust version | ||
run: rustc --version --verbose | ||
- name: Check code format | ||
run: cargo fmt --all -- --check | ||
- name: Clippy | ||
run: cargo clippy --target ${{ matrix.targets }} --all-features -- -A clippy::new_without_default | ||
- name: Build | ||
run: cargo build --target ${{ matrix.targets }} --all-features | ||
- name: Unit test | ||
if: ${{ matrix.targets == 'x86_64-unknown-linux-gnu' }} | ||
run: cargo test --target ${{ matrix.targets }} -- --nocapture | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
profile: minimal | ||
components: rust-src, rustfmt, clippy | ||
targets: ${{ matrix.targets }} | ||
override: true | ||
- name: Check rust version | ||
run: rustc --version --verbose | ||
- name: Check code format | ||
run: cargo fmt --all -- --check | ||
- name: Clippy | ||
run: cargo clippy -Z build-std=core,alloc --target ${{ matrix.targets }} --all-features -- -A clippy::new_without_default | ||
- name: Build | ||
run: cargo build -Z build-std=core,alloc --target ${{ matrix.targets }} --all-features | ||
- name: Unit test | ||
if: ${{ matrix.targets == 'x86_64-unknown-linux-gnu' }} | ||
run: cargo test --target ${{ matrix.targets }} -- --nocapture | ||
|
||
doc: | ||
runs-on: ubuntu-latest | ||
|
@@ -39,17 +47,17 @@ jobs: | |
default-branch: ${{ format('refs/heads/{0}', github.event.repository.default_branch) }} | ||
RUSTDOCFLAGS: -D rustdoc::broken_intra_doc_links -D missing-docs | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- name: Build docs | ||
continue-on-error: ${{ github.ref != env.default-branch && github.event_name != 'pull_request' }} | ||
run: | | ||
cargo doc --no-deps --all-features | ||
printf '<meta http-equiv="refresh" content="0;url=%s/index.html">' $(cargo tree | head -1 | cut -d' ' -f1) > target/doc/index.html | ||
- name: Deploy to Github Pages | ||
if: ${{ github.ref == env.default-branch }} | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
single-commit: true | ||
branch: gh-pages | ||
folder: target/doc | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- name: Build docs | ||
continue-on-error: ${{ github.ref != env.default-branch && github.event_name != 'pull_request' }} | ||
run: | | ||
cargo doc --no-deps --all-features | ||
printf '<meta http-equiv="refresh" content="0;url=%s/index.html">' $(cargo tree | head -1 | cut -d' ' -f1) > target/doc/index.html | ||
- name: Deploy to Github Pages | ||
if: ${{ github.ref == env.default-branch }} | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
single-commit: true | ||
branch: gh-pages | ||
folder: target/doc |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
/target | ||
/.vscode | ||
.vscode | ||
.DS_Store | ||
Cargo.lock | ||
.idea | ||
*.json | ||
*.xml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
[package] | ||
name = "axio" | ||
version = "0.1.1" | ||
edition = "2021" | ||
authors = ["Yuekai Jia <equation618@gmail.com>"] | ||
version = "0.1.2" | ||
edition = "2024" | ||
|
||
rust-version = "1.87.0" | ||
authors = [ | ||
"Yuekai Jia <equation618@gmail.com>", | ||
"Leo Cheng <chengkelfan@qq.com>", | ||
] | ||
description = "`std::io`-like I/O traits for `no_std` environment" | ||
license = "GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0" | ||
homepage = "https://github.com/arceos-org/arceos" | ||
|
@@ -16,4 +20,4 @@ alloc = [] | |
default = [] | ||
|
||
[dependencies] | ||
axerrno = "0.1" | ||
axerrno = { version = "0.1.0" } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,52 @@ | ||
# axio | ||
<h1 align="center" style="margin-bottom: 0;">axio</h1> | ||
|
||
<div align="left" style="margin-bottom: 1.5em"> | ||
|
||
> [`std::io`][1]-like I/O traits for `no_std` environment. | ||
|
||
</div> | ||
|
||
|
||
|
||
--- | ||
|
||
<div align="center" style=" | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
gap: 0.2em; | ||
margin: 0.2em 0; | ||
"> | ||
|
||
[](https://crates.io/crates/axio) | ||
[](https://docs.rs/axio) | ||
[](https://github.com/arceos-org/axio/actions/workflows/ci.yml) | ||
[](https://deepwiki.org/arceos-org/axio) | ||
[](https://libraries.io/cargo/axio) | ||
[](https://crates.io/crates/axio) | ||
[](https://github.com/arceos-org/axio) | ||
|
||
[`std::io`][1]-like I/O traits for `no_std` environment. | ||
[](https://github.com/arceos-org/axio/pulse) | ||
[](https://rust-lang.github.io/rustup/concepts/channels.html) | ||
[](https://github.com/arceos-org/axio/blob/main/LICENSE) | ||
|
||
</div> | ||
|
||
--- | ||
|
||
[1]: https://doc.rust-lang.org/std/io/index.html | ||
|
||
|
||
|
||
## Example | ||
|
||
```rust | ||
fn main() { | ||
use axio::{Read, BufReader}; | ||
|
||
let data = b"hello world"; | ||
let mut reader = BufReader::new(&data[..]); | ||
let mut buf = [0u8; 5]; | ||
reader.read_exact(&mut buf).unwrap(); | ||
} | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[toolchain] | ||
channel = "nightly-2025-06-18" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we don't trigger CI for other branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gh-page? ci auto dispathch ci.
is updated now:
branches-ignore:
- 'gh-pages'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i ignored
if: ${{ github.ref == env.default-branch }}
before commit and i have deletedon: push:
now