Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sorairolake committed Apr 22, 2024
1 parent baef777 commit 1cf42f0
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 31 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
key: ${{ matrix.target }}
- name: Run tests
run: cargo test --target ${{ matrix.target }}
- name: Run tests (no default features)
run: cargo test --target ${{ matrix.target }} --no-default-features

rustfmt:
name: Rustfmt
Expand Down Expand Up @@ -84,3 +86,5 @@ jobs:
uses: Swatinem/rust-cache@v2.7.3
- name: Check no lint warnings
run: cargo clippy -- -D warnings
- name: Check no lint warnings (no default features)
run: cargo clippy --no-default-features -- -D warnings
8 changes: 0 additions & 8 deletions BUILD.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ fd -t directory out ./target/*/build/favico-*

== Crate features

`bmp`::

Enable generating from the BMP image. This is enabled by default.

`dds`::

Enable generating from the DDS image. This is enabled by default.
Expand All @@ -55,10 +51,6 @@ fd -t directory out ./target/*/build/favico-*

Enable generating from the Radiance RGBE image. This is enabled by default.

`ico`::

Enable generating from the ICO image. This is enabled by default.

`jpeg`::

Enable generating from the JPEG image. This is enabled by default.
Expand Down
6 changes: 1 addition & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ clap = { version = "4.5.4", features = ["derive", "wrap_help"] }
clap_complete = "4.5.2"
clap_complete_nushell = "4.5.1"
csscolorparser = "0.6.2"
image = { version = "0.25.1", default-features = false, features = ["png", "rayon"] }
image = { version = "0.25.1", default-features = false, features = ["bmp", "ico", "png", "rayon"] }
indicatif = "0.17.8"
serde_json = { version = "1.0.116", features = ["preserve_order"] }
sysexits = "0.7.13"
Expand All @@ -38,12 +38,10 @@ tempfile = "3.10.1"

[features]
default = [
"bmp",
"dds",
"ff",
"gif",
"hdr",
"ico",
"jpeg",
"exr",
"pnm",
Expand All @@ -52,12 +50,10 @@ default = [
"tiff",
"webp",
]
bmp = ["image/bmp"]
dds = ["image/dds"]
ff = ["image/ff"]
gif = ["image/gif"]
hdr = ["image/hdr"]
ico = ["image/ico"]
jpeg = ["image/jpeg"]
exr = ["image/exr"]
pnm = ["image/pnm"]
Expand Down
4 changes: 0 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ fn generate_man_page(out_dir: &str) -> io::Result<ExitStatus> {
command
.args(["-b", "manpage"])
.args(["-a", concat!("revnumber=", env!("CARGO_PKG_VERSION"))]);
#[cfg(feature = "bmp")]
command.args(["-a", "bmp"]);
#[cfg(feature = "dds")]
command.args(["-a", "dds"]);
#[cfg(feature = "ff")]
Expand All @@ -30,8 +28,6 @@ fn generate_man_page(out_dir: &str) -> io::Result<ExitStatus> {
command.args(["-a", "gif"]);
#[cfg(feature = "hdr")]
command.args(["-a", "hdr"]);
#[cfg(feature = "ico")]
command.args(["-a", "ico"]);
#[cfg(feature = "jpeg")]
command.args(["-a", "jpeg"]);
#[cfg(feature = "exr")]
Expand Down
4 changes: 0 additions & 4 deletions docs/man/man1/favico.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,9 @@ _IMAGE_::

The possible values are:{blank}:::

ifdef::bmp,env-github,site-gen-antora[]
*bmp*::::

Windows Bitmap.
endif::[]

ifdef::dds,env-github,site-gen-antora[]
*dds*::::
Expand All @@ -126,11 +124,9 @@ ifdef::hdr,env-github,site-gen-antora[]
Radiance RGBE.
endif::[]

ifdef::ico,env-github,site-gen-antora[]
*ico*::::

ICO file format. This value also includes the CUR file format.
endif::[]

ifdef::jpeg,env-github,site-gen-antora[]
*jpeg*::::
Expand Down
6 changes: 0 additions & 6 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ impl From<Filter> for FilterType {
#[value(rename_all = "lower")]
pub enum Format {
/// Windows Bitmap.
#[cfg(feature = "bmp")]
Bmp,

/// DirectDraw Surface.
Expand All @@ -228,7 +227,6 @@ pub enum Format {
/// ICO file format.
///
/// This value also includes the CUR file format.
#[cfg(feature = "ico")]
Ico,

/// JPEG.
Expand Down Expand Up @@ -266,7 +264,6 @@ pub enum Format {
impl From<Format> for ImageFormat {
fn from(format: Format) -> Self {
match format {
#[cfg(feature = "bmp")]
Format::Bmp => Self::Bmp,
#[cfg(feature = "dds")]
Format::Dds => Self::Dds,
Expand All @@ -276,7 +273,6 @@ impl From<Format> for ImageFormat {
Format::Gif => Self::Gif,
#[cfg(feature = "hdr")]
Format::Hdr => Self::Hdr,
#[cfg(feature = "ico")]
Format::Ico => Self::Ico,
#[cfg(feature = "jpeg")]
Format::Jpeg => Self::Jpeg,
Expand Down Expand Up @@ -332,7 +328,6 @@ mod tests {

#[test]
fn from_format_to_image_format() {
#[cfg(feature = "bmp")]
assert_eq!(ImageFormat::from(Format::Bmp), ImageFormat::Bmp);
#[cfg(feature = "dds")]
assert_eq!(ImageFormat::from(Format::Dds), ImageFormat::Dds);
Expand All @@ -342,7 +337,6 @@ mod tests {
assert_eq!(ImageFormat::from(Format::Gif), ImageFormat::Gif);
#[cfg(feature = "hdr")]
assert_eq!(ImageFormat::from(Format::Hdr), ImageFormat::Hdr);
#[cfg(feature = "ico")]
assert_eq!(ImageFormat::from(Format::Ico), ImageFormat::Ico);
#[cfg(feature = "jpeg")]
assert_eq!(ImageFormat::from(Format::Jpeg), ImageFormat::Jpeg);
Expand Down
4 changes: 0 additions & 4 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,6 @@ fn generate_from_non_image_file() {

#[allow(clippy::too_many_lines)]
#[test]
#[cfg(feature = "bmp")]
fn generate_from_bmp() {
{
let out_dir = tempfile::tempdir().unwrap();
Expand Down Expand Up @@ -2112,7 +2111,6 @@ fn generate_from_hdr() {
}

#[test]
#[cfg(feature = "ico")]
fn generate_from_cur() {
{
let out_dir = tempfile::tempdir().unwrap();
Expand Down Expand Up @@ -2151,7 +2149,6 @@ fn generate_from_cur() {
}

#[test]
#[cfg(feature = "ico")]
fn generate_from_ico() {
{
let out_dir = tempfile::tempdir().unwrap();
Expand Down Expand Up @@ -2190,7 +2187,6 @@ fn generate_from_ico() {
}

#[test]
#[cfg(feature = "ico")]
fn generate_from_ico_with_wrong_format() {
let out_dir = tempfile::tempdir().unwrap();
let out_dir = out_dir.path();
Expand Down

0 comments on commit 1cf42f0

Please sign in to comment.