Skip to content

Commit

Permalink
Switch to Github Actions and prepare for 2.4 release (#13)
Browse files Browse the repository at this point in the history
Merges PR #13
  • Loading branch information
Techcable authored Feb 22, 2022
2 parents ed0f11b + 22f4a04 commit 8e0cdf4
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 34 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -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
33 changes: 33 additions & 0 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
@@ -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
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 13 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "slog-bunyan"
version = "2.3.0"
version = "2.4.0"
edition = "2018"
authors = ["Dawid Ciężarkiewicz <[email protected]>"]
description = "Bunyan formatter for slog-rs"
Expand All @@ -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"] }

0 comments on commit 8e0cdf4

Please sign in to comment.