Skip to content

Commit 4d2e434

Browse files
committed
ci: ci update
1 parent 01e5c01 commit 4d2e434

File tree

7 files changed

+312
-28
lines changed

7 files changed

+312
-28
lines changed

.github/workflows/CI.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
branches:
77
- main
88

9+
env:
10+
CARGO_TERM_COLOR: always
911

1012
jobs:
1113
test:
@@ -20,24 +22,36 @@ jobs:
2022
runs-on: ${{ matrix.os }}
2123
steps:
2224
- uses: actions/checkout@v3
23-
- uses: dtolnay/rust-toolchain@v1
25+
- uses: dtolnay/rust-toolchain@v1
2426
with:
2527
toolchain: nightly
28+
- uses: taiki-e/install-action@cargo-llvm-cov
29+
- uses: taiki-e/install-action@nextest
30+
- uses: Swatinem/rust-cache@v2
2631
- name: Test cases
2732
run: |
2833
git config --global user.name "Binbiubiubiu"
29-
git config --global user.email "[email protected]"
30-
cargo test --workspace --all --verbose
34+
git config --global user.email "[email protected]"
35+
cargo nextest run --workspace --all --verbose
36+
- name: Generate code coverage
37+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v3
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
42+
files: lcov.info
43+
fail_ci_if_error: true
3144

3245
clippy:
3346
name: cargo clippy
3447
runs-on: ubuntu-latest
3548
steps:
3649
- uses: actions/checkout@v3
37-
- uses: dtolnay/rust-toolchain@v1
50+
- uses: dtolnay/rust-toolchain@v1
3851
with:
3952
toolchain: nightly
40-
components: clippy
53+
components: clippy
54+
- uses: Swatinem/rust-cache@v2
4155
- name: Check Clippy
4256
run: |
4357
cargo clippy --workspace --all-targets
@@ -51,6 +65,7 @@ jobs:
5165
with:
5266
toolchain: stable
5367
components: rustfmt
68+
- uses: Swatinem/rust-cache@v2
5469
- name: Check formatting
5570
run: |
5671
cargo fmt --all -- --check
@@ -63,6 +78,7 @@ jobs:
6378
- uses: dtolnay/rust-toolchain@v1
6479
with:
6580
toolchain: nightly
81+
- uses: Swatinem/rust-cache@v2
6682
- name: Check documenting
6783
run: |
6884
RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc --workspace --all-features --no-deps

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/target
2-
Cargo.lock
2+
Cargo.lock

.pre-commit-config.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
fail_fast: false
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v2.3.0
5+
hooks:
6+
- id: check-byte-order-marker
7+
- id: check-case-conflict
8+
- id: check-merge-conflict
9+
- id: check-symlinks
10+
- id: check-yaml
11+
- id: end-of-file-fixer
12+
- id: mixed-line-ending
13+
- id: trailing-whitespace
14+
- repo: https://github.com/psf/black
15+
rev: 19.3b0
16+
hooks:
17+
- id: black
18+
- repo: https://github.com/crate-ci/typos
19+
rev: v1.8.1
20+
hooks:
21+
- id: typos
22+
- repo: local
23+
hooks:
24+
- id: cargo-fmt
25+
name: cargo fmt
26+
description: Format files with rustfmt.
27+
entry: bash -c 'cargo fmt -- --check'
28+
language: rust
29+
files: \.rs$
30+
args: []
31+
- id: cargo-deny
32+
name: cargo deny check
33+
description: Check cargo dependencies
34+
entry: bash -c 'cargo deny check'
35+
language: rust
36+
files: \.rs$
37+
args: []
38+
- id: cargo-check
39+
name: cargo check
40+
description: Check the package for errors.
41+
entry: bash -c 'cargo check --all'
42+
language: rust
43+
files: \.rs$
44+
pass_filenames: false
45+
- id: cargo-clippy
46+
name: cargo clippy
47+
description: Lint rust sources
48+
entry: bash -c 'cargo clippy --all-targets --all-features --tests --benches -- -D warnings'
49+
language: rust
50+
files: \.rs$
51+
pass_filenames: false
52+
- id: cargo-test
53+
name: cargo test
54+
description: unit test for the project
55+
entry: bash -c 'cargo nextest run --all-features'
56+
language: rust
57+
files: \.rs$
58+
pass_filenames: false

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ assert_fs = "1.0.7"
3333

3434
[package.metadata.docs.rs]
3535
all-features = true
36-
rustdoc-args = ["--cfg", "docsrs"]
36+
rustdoc-args = ["--cfg", "docsrs"]

README.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,57 @@
11
# git-semver-tags
22

3+
![Crates.io](https://img.shields.io/crates/v/git-semver-tags) ![Crates.io](https://img.shields.io/crates/d/git-semver-tags) ![Crates.io](https://img.shields.io/crates/l/git-semver-tags) [![CI](https://github.com/Binbiubiubiu/git-semver-tags/actions/workflows/CI.yml/badge.svg)](https://github.com/Binbiubiubiu/git-semver-tags/actions/workflows/CI.yml)
4+
5+
36
Get all git semver tags of your repository in reverse chronological order
4-
7+
58
## Install
6-
9+
710
Run
811
``` Console
912
$ cargo install git-semver-tags
1013
```
11-
14+
1215
## Usage
13-
14-
16+
17+
1518
By default, it runs check. You can easily override this, though:
1619

1720
``` Console
1821
$ git-semver-tags [OPTIONS]
1922
```
20-
23+
2124
A few examples:
22-
23-
25+
26+
2427
``` Console
2528
# Run get all tags
2629
$ git-semver-tags
27-
30+
2831
# Run to get lerna tag
2932
$ git-semver-tags --lerna
30-
33+
3134
# Run the lerna tag to get the specified package name
3235
$ git-semver-tags --lerna --package <package>
33-
36+
3437
# Runs get tag for the specified prefix
3538
$ git-semver-tags --tag-prefix <prefix>
36-
39+
3740
# Run get to ignore unstable tag
38-
$ git-semver-tags --skip-unstable
39-
41+
$ git-semver-tags --skip-unstable
42+
4043
# Run get label under the specified path
4144
$ git-semver-tags --cwd <cwd>
4245
```
43-
44-
46+
47+
4548
There's a lot more you can do! Here's a copy of the help:
46-
49+
4750
``` Console
4851
Get all git semver tags of your repository in reverse chronological order
49-
52+
5053
Usage: git-semver-tags [OPTIONS]
51-
54+
5255
Options:
5356
--lerna parse lerna style git tags
5457
--package <package> when listing lerna style tags, filter by a package
@@ -57,5 +60,5 @@
5760
--skip-unstable ignore unstable labels
5861
-h, --help Print help information
5962
-V, --version Print version information
60-
63+
6164
```

0 commit comments

Comments
 (0)