Skip to content

Commit

Permalink
Bringing back code coverage
Browse files Browse the repository at this point in the history
Also, bump some dependencies.
  • Loading branch information
idubrov committed Dec 9, 2022
1 parent 59f207f commit 7631bae
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 151 deletions.
37 changes: 0 additions & 37 deletions .circleci/config.yml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

name: Build

jobs:
check:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo build
run: cargo build --verbose

test:
name: Test
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:0.22.0
options: --security-opt seccomp=unconfined
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo test
run: cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml

- name: Codecov
uses: codecov/codecov-action@v3.1.1
with:
verbose: true
fail_ci_if_error: true

lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: Run cargo clippy
run: cargo clippy -- -D warnings
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ description = "RFC 6902, JavaScript Object Notation (JSON) Patch"
repository = "https://github.com/idubrov/json-patch"
license = "MIT/Apache-2.0"
readme = "README.md"
edition = "2018"
edition = "2021"

[features]
default = ["diff"]
nightly = []
diff = ["treediff"]

[dependencies]
serde = { version = "1.0.99", features = ["derive"] }
serde_json = "1.0.40"
serde = { version = "1.0.149", features = ["derive"] }
serde_json = "1.0.89"

[dependencies.treediff]
version = "3.0.1"
version = "4.0.2"
features = ["with-serde-json"]
optional = true

[dev-dependencies]
rand = "0.5.0"
serde_json = { version = "1.0.40", features = ["preserve_order"] }
rand = "0.8.5"
serde_json = { version = "1.0.89", features = ["preserve_order"] }
8 changes: 2 additions & 6 deletions tests/bench.rs → benches/bench.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#![feature(test)]
#![cfg(feature = "nightly")]
extern crate json_patch;
extern crate rand;
extern crate serde_json;
extern crate test;

use self::rand::SeedableRng;
use self::test::Bencher;
use json_patch::*;
use rand::SeedableRng;
use test::Bencher;

mod generator;

Expand Down
6 changes: 3 additions & 3 deletions tests/generator/mod.rs → benches/generator/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::rand::distributions::Alphanumeric;
use super::rand::Rng;
use super::{AddOperation, Patch, PatchOperation, RemoveOperation};
use json_patch::{AddOperation, Patch, PatchOperation, RemoveOperation};
use rand::distributions::Alphanumeric;
use rand::Rng;
use serde_json::{Map, Value};
use std::fmt::Write;

Expand Down
19 changes: 0 additions & 19 deletions ci/job-check.yml

This file was deleted.

16 changes: 0 additions & 16 deletions ci/job-rustfmt.yml

This file was deleted.

29 changes: 0 additions & 29 deletions ci/job-test.yml

This file was deleted.

35 changes: 0 additions & 35 deletions ci/steps-install-rust.yml

This file was deleted.

0 comments on commit 7631bae

Please sign in to comment.