diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..c2576f2 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,34 @@ +name: Quality Checks + +on: + workflow_call: + +jobs: + check: + name: Quality Checks + runs-on: ubuntu-latest + + 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 + + - 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 \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..162cc24 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,62 @@ +name: Deploy + +on: + push: + branches: + - main + 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, test] + 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/release-plz.yml b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/release-plz.yml rename to .github/workflows/release.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 715b302..f40fb59 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,7 @@ name: Test on: - push: - branches: - - main - pull_request: + workflow_call: jobs: test: @@ -15,7 +12,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 {}