diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml new file mode 100644 index 0000000..dce5654 --- /dev/null +++ b/.github/workflows/clippy.yml @@ -0,0 +1,36 @@ +# This is the clippy workflow, seperate from the main 'Rust' workflow +# +# This is copied from slog-rs/slog +# +# TODO: Should clippy success be required or not? +on: [push, pull_request] +name: Clippy + +env: + CARGO_TERM_COLOR: always + # has a history of occasional bugs (especially on old versions) + # + # the ci is free so we might as well use it ;) + CARGO_INCREMENTAL: 0 + + +jobs: + clippy: + # Only run on PRs if the source branch is on someone else's repo + if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + components: clippy + - shell: bash + run: | + cargo clippy diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml new file mode 100644 index 0000000..e3943f1 --- /dev/null +++ b/.github/workflows/rustfmt.yml @@ -0,0 +1,33 @@ +# The file is the workflow for rustfmt +# +# It runs `cargo fmt --check` +# +# It will fail if there are formatting problems. +# +# Mostly copied from slog-rs/slog +on: [push, pull_request] +name: rustfmt + +env: + CARGO_TERM_COLOR: always + +jobs: + rustfmt: + # Only run on PRs if the source branch is on someone else's repo + if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + components: rustfmt + - shell: bash + run: | + cargo fmt -- --check diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..80953ab --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,46 @@ +# We use `actions-rs` for most of our actions +# +# This file is for the main tests. clippy & rustfmt are seperate workflows +# +# This is mostly copied from slog-rs repo ;) +on: [push, pull_request] +name: Cargo Test + +env: + CARGO_TERM_COLOR: always + # has a history of occasional bugs (especially on old versions) + # + # the ci is free so we might as well use it ;) + CARGO_INCREMENTAL: 0 + + +# Tested versions: +# 1. stable +# 2. nightly +# 3. Minimum Supported Rust Version (MSRV) + +jobs: + test: + # Only run on PRs if the source branch is on someone else's repo + if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} + + runs-on: ubuntu-latest + strategy: + fail-fast: false # Even if one job fails we still want to see the other ones + matrix: + # 1.53 is MSRV. Keep this in sync with Cargo.toml + rust: [1.53, stable, nightly] + # NOTE: We don't really have any "feature combos" to test. + # + # We just have default features and nothing else :) + + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + # NOTE: This crate is simple enough we don't need seperate check/test actions + - name: Test + run: | + cargo test --verbose diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 32b58b3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: rust -rust: - - stable - - beta - - nightly - -script: - - | - if [[ $TRAVIS_RUST_VERSION == *stable* ]] - then - rustup component add rustfmt - cargo fmt --version - cargo fmt -- --check || (echo "Please reformat your code with 'cargo fmt' (version $(cargo fmt --version))"; false) - fi - - make all - - make travistest - - if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then make bench ; fi - -env: - global: - - RUST_BACKTRACE=1 - matrix: - - - - RELEASE=true - -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/6d8e17dd2fa83b143168 - on_success: change # options: [always|never|change] default: always - on_failure: change # options: [always|never|change] default: always - on_start: false # default: false diff --git a/CHANGELOG.md b/CHANGELOG.md index b9a807e..2f8eae4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] + +## 2.4.0 - 2022-02-19 +### Changed + +* Switch from `chrono` to `time` (PR #11 by @ShellWowza) + * Based on disucssion in the PR, this actually corrects a bug in the time formatting output +* Upgrade to using Rust 2018 +* Bump Minimum Supported Rust Version (MSRV) to 1.53 + * This is required because of the `time` crate +* Switch from Travis to Github Actions +* Require `slog-json` version >= `2.6` + ## 2.3.0 - 2021-01-10 ### Changed diff --git a/Cargo.toml b/Cargo.toml index 39fe59b..72877ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "slog-bunyan" -version = "2.3.0" +version = "2.4.0" edition = "2018" authors = ["Dawid Ciężarkiewicz "] description = "Bunyan formatter for slog-rs" @@ -11,11 +11,22 @@ homepage = "https://github.com/slog-rs/slog" repository = "https://github.com/slog-rs/bunyan" readme = "README.md" +# This is our Minimum Supported Rust Version (MSRV) +# +# Please do not bump this unnecessarily. +# Changing this bumps the minor version for semver (2.x for semver). +# +# NOTE: Changing this requires updating github actions +# +# The first version of Cargo that supports this field was in Rust 1.56.0. +# In older releases, the field will be ignored, and Cargo will display a warning. +rust-version = "1.53" + [lib] path = "lib.rs" [dependencies] slog = "2" -slog-json = "2" +slog-json = "2.6" hostname = "0.3.0" time = { version = "0.3.6", features = ["formatting", "local-offset", "macros"] }