From 0c36c4b5f96e09e26caafafbfcaa5736dfeb7fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=9D=E5=80=89=E6=B0=B4=E5=B8=8C?= Date: Fri, 6 Feb 2026 11:44:33 +0800 Subject: [PATCH 1/3] ci: split into multiple files --- .github/workflows/check.yml | 44 ++++++++++++++++++++++++++++ .github/workflows/ci.yml | 58 ------------------------------------- .github/workflows/docs.yml | 52 +++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 58 deletions(-) create mode 100644 .github/workflows/check.yml delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..c27cc8b --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,44 @@ +name: Check + +on: [push, pull_request] + +env: + RUST_BACKTRACE: 1 + +jobs: + rustfmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt + + - name: Check format + run: cargo fmt --all --check + + check: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + rust-toolchain: + - nightly + - nightly-2025-05-20 + - nightly-2025-12-12 + - stable + env: + RUSTC_BOOTSTRAP: "${{ matrix.rust-toolchain == 'stable' && '1' || '' }}" + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust-toolchain }} + components: clippy + + - uses: taiki-e/install-action@cargo-hack + - name: Clippy + run: cargo hack clippy --feature-powerset -- -D warnings + - name: Test + run: cargo hack test --feature-powerset -- --nocapture diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index f4209e7..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: CI - -on: [push, pull_request] - -jobs: - ci: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - rust-toolchain: - - nightly - - nightly-2025-05-20 - - nightly-2025-12-12 - - stable - env: - RUSTC_BOOTSTRAP: "${{ matrix.rust-toolchain == 'stable' && '1' || '' }}" - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@nightly - with: - toolchain: ${{ matrix.rust-toolchain }} - components: rust-src, clippy, rustfmt - - name: Check rust version - run: rustc --version --verbose - - name: Check code format - run: cargo fmt --all --check - - - uses: taiki-e/install-action@cargo-hack - - name: Clippy - run: cargo hack clippy --feature-powerset - - name: Unit test - run: cargo hack test --feature-powerset -- --nocapture - - doc: - runs-on: ubuntu-latest - strategy: - fail-fast: false - permissions: - contents: write - env: - 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 '' $(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 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..eb96017 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,52 @@ +name: Docs + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +env: + RUST_BACKTRACE: 1 + RUSTDOCFLAGS: -D rustdoc::broken_intra_doc_links -D missing-docs + +defaults: + run: + shell: bash + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@nightly + + - name: Build docs + run: cargo doc --all-features --no-deps + + - name: Add redirect + run: printf '' $(cargo tree | head -1 | cut -d' ' -f1) > target/doc/index.html + + - uses: actions/configure-pages@v5 + - uses: actions/upload-pages-artifact@v4 + with: + path: target/doc + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 From 9662d32f719c4acf75a26134370cfab8943bd8b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=9D=E5=80=89=E6=B0=B4=E5=B8=8C?= Date: Fri, 6 Feb 2026 11:50:53 +0800 Subject: [PATCH 2/3] chore: update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ee809b..b66d671 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Crates.io](https://img.shields.io/crates/v/axio)](https://crates.io/crates/axio) [![Docs.rs](https://docs.rs/axio/badge.svg)](https://docs.rs/axio) -[![CI](https://github.com/arceos-org/axio/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/arceos-org/axio/actions/workflows/ci.yml) +[![CI](https://github.com/arceos-org/axio/actions/workflows/check.yml/badge.svg?branch=main)](https://github.com/arceos-org/axio/actions/workflows/check.yml) [`std::io`][1]-like I/O traits for `no_std` environment. From dc3ee6bc43a8038f1e939015ebdc6bff94a22752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=9D=E5=80=89=E6=B0=B4=E5=B8=8C?= Date: Fri, 6 Feb 2026 15:05:47 +0800 Subject: [PATCH 3/3] ci: run docs on all branches and only deploy on main --- .github/workflows/docs.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index eb96017..35c6007 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,15 +1,6 @@ name: Docs -on: - push: - branches: - - main - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write +on: [push, pull_request] concurrency: group: pages @@ -44,6 +35,11 @@ jobs: deploy: runs-on: ubuntu-latest needs: build + if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} + permissions: + contents: read + pages: write + id-token: write environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }}