From 9e96e378ff7fec42028eaec1a98fee7f1935e32c Mon Sep 17 00:00:00 2001 From: YanLien Date: Tue, 27 Jan 2026 14:47:07 +0800 Subject: [PATCH 1/6] feat: add GitHub Actions workflows for quality checks and deployment --- .github/workflows/check.yml | 43 ++++++++++++++++++++++++ .github/workflows/deploy.yml | 65 ++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 2 -- rdrive/src/manager.rs | 6 ---- 4 files changed, 108 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/check.yml create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..df24dcd --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,43 @@ +name: Quality Checks + +on: + workflow_call: + +jobs: + check: + name: Quality Checks + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + targets: + - aarch64-unknown-none-softfloat + - aarch64-unknown-none + - riscv64gc-unknown-none-elf + - x86_64-unknown-none + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: nightly + 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: Build + run: cargo build + + - name: Run clippy + run: cargo clippy + + - name: Build documentation + run: cargo doc --no-deps --target ${{ matrix.targets }} \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..15cd1a0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,65 @@ +name: Deploy + +on: + push: + branches: + - '**' + tags-ignore: + - 'v*' + - 'v*-pre.*' + pull_request: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: 'pages' + cancel-in-progress: false + +jobs: + quality-check: + uses: ./.github/workflows/check.yml + + test: + uses: ./.github/workflows/test.yml + + build-doc: + name: Build documentation + runs-on: ubuntu-latest + needs: quality-check + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: nightly + components: rust-src + + - name: Build docs + run: cargo doc --no-deps + + - name: Create index redirect + run: | + printf '' > target/doc/index.html + + - name: Upload artifact + uses: actions/upload-pages-artifact@v4 + with: + path: target/doc + + deploy-doc: + name: Deploy to GitHub Pages + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build-doc + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 715b302..5712811 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,5 @@ jobs: uses: actions/checkout@v5 - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable - - name: Build - run: cargo build - name: Run tests run: cargo test -p rdrive \ No newline at end of file diff --git a/rdrive/src/manager.rs b/rdrive/src/manager.rs index 502cb12..b53a98b 100644 --- a/rdrive/src/manager.rs +++ b/rdrive/src/manager.rs @@ -146,12 +146,6 @@ mod tests { let container = DeviceContainer::default(); let dev = container.get_one::(); assert!(dev.is_none(), "Expected no devices found"); - - if let Some(dev) = dev { - let weak = dev.lock().unwrap(); - let f = weak.parse_dtb_fn(); - assert!(f.is_none(), "Expected no parse function for empty device"); - } } struct IrqTest {} From f93a6afe5e0e579882532db4a340ca220be7b4d0 Mon Sep 17 00:00:00 2001 From: YanLien Date: Tue, 27 Jan 2026 14:52:10 +0800 Subject: [PATCH 2/6] feat: add workflow_call trigger to GitHub Actions test workflow --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5712811..caac64f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,7 @@ on: branches: - main pull_request: + workflow_call: jobs: test: From 4743544009c36f71e7d10b15720f88d85ac1ec2f Mon Sep 17 00:00:00 2001 From: YanLien Date: Tue, 27 Jan 2026 14:54:22 +0800 Subject: [PATCH 3/6] fix: remove target specification from documentation build step in CI workflow --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index df24dcd..427089f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -40,4 +40,4 @@ jobs: run: cargo clippy - name: Build documentation - run: cargo doc --no-deps --target ${{ matrix.targets }} \ No newline at end of file + run: cargo doc --no-deps \ No newline at end of file From e2299b62a8379cbf4fd804efc0f36b46c18ec75e Mon Sep 17 00:00:00 2001 From: YanLien Date: Tue, 27 Jan 2026 15:17:45 +0800 Subject: [PATCH 4/6] feat: update deployment workflows by adding release.yml and modifying deploy.yml --- .github/workflows/deploy.yml | 5 +---- .github/workflows/{release-plz.yml => release.yml} | 0 2 files changed, 1 insertion(+), 4 deletions(-) rename .github/workflows/{release-plz.yml => release.yml} (100%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 15cd1a0..250716f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,9 +4,6 @@ on: push: branches: - '**' - tags-ignore: - - 'v*' - - 'v*-pre.*' pull_request: permissions: @@ -28,7 +25,7 @@ jobs: build-doc: name: Build documentation runs-on: ubuntu-latest - needs: quality-check + needs: [quality-check, test] steps: - name: Checkout code uses: actions/checkout@v5 diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/release-plz.yml rename to .github/workflows/release.yml From 2d13c55d32933832f499a15d47e5bea7b84c4658 Mon Sep 17 00:00:00 2001 From: YanLien Date: Tue, 27 Jan 2026 15:24:20 +0800 Subject: [PATCH 5/6] fix: remove target matrix from quality checks workflow --- .github/workflows/check.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 427089f..c2576f2 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -7,14 +7,6 @@ jobs: check: name: Quality Checks runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - targets: - - aarch64-unknown-none-softfloat - - aarch64-unknown-none - - riscv64gc-unknown-none-elf - - x86_64-unknown-none steps: - name: Checkout code @@ -25,7 +17,6 @@ jobs: with: toolchain: nightly components: rust-src, clippy, rustfmt - targets: ${{ matrix.targets }} - name: Check rust version run: rustc --version --verbose From 0615c3a4cfb8e607853b9a5be24308d1c05b0ee3 Mon Sep 17 00:00:00 2001 From: YanLien Date: Tue, 27 Jan 2026 15:56:40 +0800 Subject: [PATCH 6/6] ci: add modular GitHub Actions workflows and fix reusable workflow configuration --- .github/workflows/deploy.yml | 2 +- .github/workflows/test.yml | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 250716f..162cc24 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,7 +3,7 @@ name: Deploy on: push: branches: - - '**' + - main pull_request: permissions: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index caac64f..f40fb59 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,6 @@ name: Test on: - push: - branches: - - main - pull_request: workflow_call: jobs: