Skip to content

Commit 2b57966

Browse files
authored
Merge pull request #29 from Techcable/switch/gh-actions
Switch to Github Actions and prepare for 2.6 release
2 parents 4f0d200 + 5a9645e commit 2b57966

File tree

7 files changed

+142
-27
lines changed

7 files changed

+142
-27
lines changed

.github/workflows/clippy.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This is the clippy workflow, seperate from the main 'Rust' workflow
2+
#
3+
# This will fail if clippy fails (if we encounter any of its "correctness" lints)
4+
#
5+
# Clippy warnings won't fail the build. They may or may not turn into Github warnings.
6+
on: [push, pull_request]
7+
name: Clippy
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
# has a history of occasional bugs (especially on old versions)
12+
#
13+
# the ci is free so we might as well use it ;)
14+
CARGO_INCREMENTAL: 0
15+
16+
17+
jobs:
18+
clippy:
19+
# Only run on PRs if the source branch is on someone else's repo
20+
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
rust:
25+
- stable
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: actions-rs/toolchain@v1
29+
with:
30+
profile: minimal
31+
toolchain: ${{ matrix.rust }}
32+
override: true
33+
components: clippy
34+
- shell: bash
35+
run: |
36+
cargo clippy

.github/workflows/rustfmt.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# The file is the workflow for rustfmt
2+
#
3+
# It runs `cargo fmt --check`
4+
#
5+
# It will fail if there are formatting problems.
6+
on: [push, pull_request]
7+
name: rustfmt
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
rustfmt:
14+
# Only run on PRs if the source branch is on someone else's repo
15+
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
rust:
20+
- stable
21+
steps:
22+
- uses: actions/checkout@v2
23+
- uses: actions-rs/toolchain@v1
24+
with:
25+
profile: minimal
26+
toolchain: ${{ matrix.rust }}
27+
override: true
28+
components: rustfmt
29+
- shell: bash
30+
run: |
31+
cargo fmt -- --check

.github/workflows/test.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# We use `actions-rs` for most of our actions
2+
#
3+
# This file is for the main tests. clippy & rustfmt are seperate workflows
4+
#
5+
# It is mostly copied from slog-rs/slog
6+
on: [push, pull_request]
7+
name: Cargo Test
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
# has a history of occasional bugs (especially on old versions)
12+
#
13+
# the ci is free so we might as well use it ;)
14+
CARGO_INCREMENTAL: 0
15+
16+
17+
# Tested versions:
18+
# 1. stable
19+
# 2. nightly
20+
# 3. Minimum Supported Rust Version (MSRV)
21+
22+
jobs:
23+
test:
24+
# Only run on PRs if the source branch is on someone else's repo
25+
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
26+
27+
runs-on: ubuntu-latest
28+
strategy:
29+
fail-fast: false # Even if one job fails we still want to see the other ones
30+
matrix:
31+
# 1.53 is MSRV. Keep in sync with Cargo.toml
32+
rust: [1.53, stable, nightly]
33+
# NOTE: Features to test must be specified manually. They are applied to all versions seperately.
34+
#
35+
# This has the advantage of being more flexibile and thorough
36+
# This has the disadvantage of being more vebrose
37+
#
38+
# Specific feature combos can be overriden per-version with 'include' and 'exclude'
39+
features: ["", "nested-values", "dynamic-keys", "nested-values dynamic-keys"]
40+
41+
steps:
42+
- uses: actions/checkout@v2
43+
- uses: actions-rs/toolchain@v1
44+
with:
45+
toolchain: ${{ matrix.rust }}
46+
override: true
47+
# NOTE: We only run `cargo test`. No need for a seperate `cargo check`
48+
- name: Test
49+
run: |
50+
cargo test --verbose --features "${{ matrix.features }}"
51+

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
88

9+
## 2.6.0 - 2022-02-20
10+
### Changed
11+
* Replaced `chrono` with `time` (PR #28). Thanks @ShellWowza
12+
* Bump Minimum Supported Rust Version from `1.38` -> `1.53`
13+
* Switch to Github Actions
14+
15+
## 2.5.0 - 2022-01-21
16+
### Changed
17+
* Upgrade to Rust 2018
18+
* Relicense to Apache/MIT/MPL
19+
* Previous license was MPL only, so this is actually more permissive
20+
21+
### Security
22+
* Disable default features of chrono. Avoids [RUSTSEC-2020-0071](https://rustsec.org/advisories/RUSTSEC-2020-0071.html)
23+
924
## 2.4.0 - 2021-07-28
1025
### Added
1126

Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "slog-json"
3-
version = "2.5.0"
3+
version = "2.6.0"
44
edition = "2018"
55
authors = ["Dawid Ciężarkiewicz <[email protected]>"]
66
description = "JSON drain for slog-rs"
@@ -10,6 +10,14 @@ documentation = "https://docs.rs/slog-json"
1010
homepage = "https://github.com/slog-rs/slog"
1111
repository = "https://github.com/slog-rs/json"
1212
readme = "README.md"
13+
# This is our Minimum Supported Rust Version (MSRV)
14+
#
15+
# Please do not bump this unnecessarily.
16+
# Changing this should bump the minor version for semver (2.x for semver).
17+
#
18+
# The first version of Cargo that supports this field was in Rust 1.56.0.
19+
# In older releases, the field will be ignored, and Cargo will display a warning.
20+
rust-version = "1.53"
1321

1422
[features]
1523
nested-values = ["erased-serde", "slog/nested-values"]

examples/pretty.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ extern crate slog_json;
55

66
use slog::Drain;
77

8-
98
fn main() {
109
let drain = slog_json::Json::new(std::io::stdout())
1110
.set_pretty(true)

0 commit comments

Comments
 (0)