diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 619a8fe..26d140c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,28 +19,35 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build - run: cargo build --verbose --all-features + run: | + cargo build --verbose --no-default-features + cargo build --verbose --all-features - name: Run tests - run: cargo test --verbose --all-features - - - name: Run cargo fmt - run: cargo fmt --all -- --check + run: | + cargo test --verbose --no-default-features + cargo test --verbose --all-features - name: Run cargo clippy - run: cargo clippy --all-features -- -D warnings - - - name: Tarpaulin code coverage - id: coverage - if: matrix.os == 'ubuntu-latest' run: | - cargo install cargo-tarpaulin - cargo tarpaulin -o xml + cargo clippy --no-default-features -- -D warnings + cargo clippy --all-features -- -D warnings - - name: Upload to codecov.io - if: matrix.os == 'ubuntu-latest' - uses: codecov/codecov-action@v3 + - name: Run cargo fmt + run: | + cargo fmt --all -- --check + + #- name: Tarpaulin code coverage + # id: coverage + # if: matrix.os == 'ubuntu-latest' + # run: > + # cargo install cargo-tarpaulin && + # cargo tarpaulin -o xml + + #- name: Upload to codecov.io + # if: matrix.os == 'ubuntu-latest' + # uses: codecov/codecov-action@v3 diff --git a/Cargo.toml b/Cargo.toml index ffe50ef..57481f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,10 @@ default = ["named-colors"] named-colors = ["phf"] rust-rgb = ["rgb"] +[[test]] +name = "named_colors" +required-features = ["named-colors"] + [dependencies] cint = { version = "^0.3.1", optional = true } lab = { version = "0.11.0", optional = true } diff --git a/Makefile b/Makefile index b2c4d5c..d8b45f6 100644 --- a/Makefile +++ b/Makefile @@ -5,9 +5,12 @@ SHELL := /bin/bash all: check test check: + cargo build --no-default-features && \ + cargo clippy --no-default-features -- -D warnings && \ cargo build --all-features && \ cargo clippy --all-features -- -D warnings && \ cargo fmt --all -- --check test: + cargo test --no-default-features && \ cargo test --all-features diff --git a/tests/named_colors.rs b/tests/named_colors.rs index 57f3d98..f3f4b86 100644 --- a/tests/named_colors.rs +++ b/tests/named_colors.rs @@ -1,6 +1,5 @@ use csscolorparser::Color; -#[cfg(feature = "named-colors")] #[test] fn named_colors() { let skip_list = ["aqua", "cyan", "fuchsia", "magenta"];