Skip to content

Commit

Permalink
Merge pull request #166 from ehuss/gha
Browse files Browse the repository at this point in the history
Switch to GitHub Actions
  • Loading branch information
oli-obk authored Oct 23, 2021
2 parents 7e41be6 + 34b6160 commit 312b8a5
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 25 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI
on: [push, pull_request]

jobs:
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install rust
run: rustup update --no-self-update stable && rustup default stable
- name: Check formatting
run: cargo fmt -- --check

test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
include:
- rust: stable
- rust: beta
- rust: nightly
- rust: 1.40.0
steps:
- uses: actions/checkout@v2
- name: Install rust
run: rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- name: Run tests
run: |
cargo build --verbose
cargo build --verbose --no-default-features
cargo test --verbose
cargo test --verbose --no-default-features
cargo test --verbose --all-features
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions src/dependency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
use std::fmt;

use camino::Utf8PathBuf;
use semver::VersionReq;
use serde::{Deserialize, Deserializer, Serialize};
#[cfg(feature = "builder")]
use derive_builder::Builder;
use semver::VersionReq;
use serde::{Deserialize, Deserializer, Serialize};

#[derive(Eq, PartialEq, Clone, Debug, Copy, Hash, Serialize, Deserialize)]
/// Dependencies can come in three kinds
Expand Down
4 changes: 2 additions & 2 deletions src/diagnostic.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! This module contains `Diagnostic` and the types/functions it uses for deserialization.
use serde::{Deserialize, Serialize};
use std::fmt;
#[cfg(feature = "builder")]
use derive_builder::Builder;
use serde::{Deserialize, Serialize};
use std::fmt;

/// The error code associated to this diagnostic.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
Expand Down
6 changes: 5 additions & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Error::CargoMetadata { stderr } => {
write!(f, "`cargo metadata` exited with an error: {}", stderr.trim_end())
write!(
f,
"`cargo metadata` exited with an error: {}",
stderr.trim_end()
)
}
Error::Io(err) => write!(f, "failed to start `cargo metadata`: {}", err),
Error::Utf8(err) => write!(f, "cannot convert the stdout of `cargo metadata`: {}", err),
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@
//! ```
use camino::Utf8PathBuf;
#[cfg(feature = "builder")]
use derive_builder::Builder;
use std::collections::HashMap;
use std::env;
use std::fmt;
use std::path::PathBuf;
use std::process::Command;
use std::str::from_utf8;
#[cfg(feature = "builder")]
use derive_builder::Builder;

pub use camino;
pub use semver::Version;
Expand Down
4 changes: 2 additions & 2 deletions src/messages.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use super::{Diagnostic, PackageId, Target};
use camino::Utf8PathBuf;
#[cfg(feature = "builder")]
use derive_builder::Builder;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::io::{self, BufRead, Lines, Read};
#[cfg(feature = "builder")]
use derive_builder::Builder;

/// Profile settings used to determine which compiler flags to use for a
/// target.
Expand Down
2 changes: 1 addition & 1 deletion tests/selftest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::path::PathBuf;
use semver::Version;

use cargo_metadata::{CargoOpt, Error, MetadataCommand};
use serde::{Deserialize};
use serde::Deserialize;

#[derive(Debug, PartialEq, Eq, Deserialize)]
struct TestPackageMetadata {
Expand Down

0 comments on commit 312b8a5

Please sign in to comment.