Skip to content

Commit

Permalink
Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
RoDmitry committed Dec 24, 2023
1 parent c2f7af0 commit 4960161
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Rust

on:
push:
branches:
- main
paths:
- 'src/**'
pull_request:
branches:
- main

env:
CARGO_TERM_COLOR: always

jobs:
x86:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Rust Version
run: rustc -V

- name: Format
run: cargo fmt -- --check

- name: Cargo check
run: cargo check --verbose

- name: Clippy
run: cargo clippy --verbose -- -Dwarnings

- name: Std
run: cargo test --verbose

- name: Prepare
# gcc-multilib is needed for i686
run: sudo apt-get update && sudo apt-get install -y gcc-multilib

- name: Install i686 target
run: rustup target add i686-unknown-linux-gnu
- name: i686 (32 bits)
run: cargo test --target=i686-unknown-linux-gnu --verbose
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! Provides [`Merge`][], a trait for objects that can be merged.
//!
//! # Usage
//!
//! ```
//! trait Merge {
//! fn merge(&mut self, other: Self);
//! }
//! ```
//!
//! # Usage
//!
//! The [`Merge`][] trait can be used to merge two objects of the same type into one. The intended
//! use case is merging configuration from different sources, for example environment variables,
//! multiple configuration files and command-line arguments, see the [`args.rs`][] example.
Expand Down
1 change: 1 addition & 0 deletions tests/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ fn test_unnamed_fields_skip() {
}

#[test]
#[cfg(feature = "std")]
fn test_default_strategy() {
#[derive(Debug, Merge, PartialEq)]
struct N(#[merge(strategy = ::merge2::num::saturating_add)] u8);
Expand Down
1 change: 1 addition & 0 deletions tests/strategies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ fn test_option_overwrite_none() {
}

#[test]
#[cfg(feature = "std")]
fn test_option_recursive() {
#[derive(Debug, Merge, PartialEq)]
struct N(#[merge(strategy = ::merge2::num::saturating_add)] u8);
Expand Down

0 comments on commit 4960161

Please sign in to comment.