diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7cff937..57665a7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -29,18 +29,13 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/install-msrv + - name: Install MSRV + uses: ./.github/actions/install-msrv - name: Install Neovim ${{ matrix.neovim }} uses: rhysd/action-setup-vim@v1 with: neovim: true version: ${{ matrix.neovim }} - - name: Install libluajit (Linux) - if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y libluajit-5.1-dev - - name: Install libluajit (macOS) - if: runner.os == 'macOS' - run: brew install luajit - name: Run tests run: cargo test --workspace ${{ matrix.features }} @@ -49,10 +44,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/install-msrv + - name: Install MSRV with Clippy + uses: ./.github/actions/install-msrv with: components: clippy - - run: cargo clippy --all-features --workspace --tests -- -D warnings + - run: > + cargo clippy + --features neovim-nightly,libuv,mlua,test,test-terminator + --workspace + --tests + -- -D warnings docs: name: docs @@ -60,7 +61,10 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@nightly - - run: RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--cfg docsrs" cargo doc --features neovim-nightly + - run: > + RUSTFLAGS="-D warnings" + RUSTDOCFLAGS="--cfg docsrs" + cargo doc --features neovim-nightly format: name: format diff --git a/Cargo.toml b/Cargo.toml index a294c77..3a68e77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,19 +41,23 @@ license.workspace = true keywords.workspace = true [package.metadata.docs.rs] -features = ["neovim-nightly", "libuv", "mlua", "test", "__vendored_luajit"] +default-features = false +features = ["__docsrs", "neovim-nightly", "libuv", "mlua", "test"] rustdoc-args = ["--cfg", "docsrs"] [features] +default = ["__no_docsrs"] neovim-0-10 = ["api/neovim-0-10"] neovim-0-11 = ["api/neovim-0-10", "api/neovim-0-11"] neovim-nightly = ["neovim-0-11", "api/neovim-nightly"] +__docsrs = ["mlua?/vendored"] +__no_docsrs = ["mlua?/module"] + libuv = ["dep:libuv"] mlua = ["dep:mlua"] test = ["macros/test", "dep:cargo_metadata"] test-terminator = ["test", "libuv", "macros/test-terminator"] -__vendored_luajit = ["mlua/vendored"] [dependencies] api = { workspace = true } diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 7cc2d07..58f7b46 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -20,8 +20,9 @@ thiserror = { workspace = true } [target.'cfg(not(any(target_os = "windows", target_env = "msvc")))'.dependencies] nvim-oxi = { path = "..", features = ["libuv", "mlua", "test"] } +# Enabling libuv will cause the build to fail on Windows. [target.'cfg(any(target_os = "windows", target_env = "msvc"))'.dependencies] -nvim-oxi = { path = "..", features = ["mlua", "test", "__vendored_luajit"] } +nvim-oxi = { path = "..", features = ["mlua", "test"] } [build-dependencies] nvim-oxi = { path = "..", features = ["test"] }