Skip to content

Commit f26df42

Browse files
authored
ci: split up CI jobs (#52)
1 parent bf6d7bc commit f26df42

File tree

9 files changed

+321
-163
lines changed

9 files changed

+321
-163
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
merge_group:
7+
types: [checks_requested]
8+
push:
9+
branches: [master]
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
env:
19+
CARGO_TERM_COLOR: always
20+
21+
jobs:
22+
read_msrv:
23+
name: Read MSRV
24+
uses: actions-rust-lang/msrv/.github/workflows/[email protected]
25+
26+
rust:
27+
needs: read_msrv
28+
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
os:
33+
- { name: Linux, runner: ubuntu-latest }
34+
- { name: macOS, runner: macos-latest }
35+
- { name: Windows, runner: windows-latest }
36+
toolchain:
37+
- { name: stable, version: stable }
38+
- { name: msrv, version: "${{ needs.read_msrv.outputs.msrv }}" }
39+
40+
name: ${{ matrix.os.name }} / ${{ matrix.toolchain.name }}
41+
runs-on: ${{ matrix.os.runner }}
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Install Rust (${{ matrix.toolchain.name }})
47+
uses: actions-rust-lang/[email protected]
48+
with:
49+
toolchain: ${{ matrix.toolchain.version }}
50+
51+
- name: Install just, nextest
52+
uses: taiki-e/[email protected]
53+
with:
54+
tool: just,nextest
55+
56+
- name: Test
57+
run: just test

.github/workflows/coverage.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
coverage:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Install Rust
21+
uses: actions-rust-lang/[email protected]
22+
with:
23+
components: llvm-tools-preview
24+
25+
- name: Install just & cargo-llvm-cov
26+
uses: taiki-e/[email protected]
27+
with:
28+
tool: just,cargo-llvm-cov
29+
30+
- name: Generate code coverage
31+
run: just test-coverage-codecov
32+
33+
- name: Upload coverage to Codecov
34+
uses: codecov/[email protected]
35+
with:
36+
files: codecov.json
37+
fail_ci_if_error: true
38+
env:
39+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/lint.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
clippy:
16+
runs-on: ubuntu-latest
17+
18+
permissions:
19+
contents: read
20+
checks: write
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Install Rust
26+
uses: actions-rust-lang/[email protected]
27+
with:
28+
components: clippy
29+
30+
- name: Install just, cargo-hack
31+
uses: taiki-e/[email protected]
32+
with:
33+
tool: just,cargo-hack
34+
35+
- name: Check with Clippy
36+
run: just clippy
37+
38+
rustfmt:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Install Rust (nightly)
44+
uses: actions-rust-lang/[email protected]
45+
with:
46+
toolchain: nightly
47+
components: rustfmt
48+
49+
- name: Check with Rustfmt
50+
run: cargo fmt -- --check
51+
52+
docs:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- name: Install Rust (nightly)
58+
uses: actions-rust-lang/[email protected]
59+
with:
60+
toolchain: nightly
61+
components: rust-docs
62+
63+
- name: Check for broken intra-doc links
64+
env:
65+
RUSTDOCFLAGS: -D warnings
66+
run: cargo doc --workspace --no-deps --all-features
67+
68+
sorted-deps:
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v4
72+
73+
- name: Install Rust
74+
uses: actions-rust-lang/[email protected]
75+
with:
76+
components: clippy
77+
78+
- name: Install just, cargo-sort
79+
uses: taiki-e/[email protected]
80+
with:
81+
tool: just,cargo-sort
82+
83+
- name: Check dependency requirements are sorted lexicographically
84+
run: cargo sort --workspace --check

.github/workflows/rust.yml

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

Cargo.toml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
[package]
22
name = "bytesize"
3-
description = "A utility for human-readable bytes representations. Forked from https://github.com/hyunsik/bytesize ."
4-
version = "1.4.0-dev"
3+
description = "A utility for human-readable byte count representations"
4+
version = "1.3.0"
55
authors = ["Hyunsik Choi <[email protected]>", "MrCroxx <[email protected]>"]
6-
edition = "2021"
7-
8-
homepage = "https://github.com/hyunsik/bytesize/"
9-
documentation = "https://docs.rs/bytesize/"
10-
repository = "https://github.com/hyunsik/bytesize/"
11-
readme = "README.md"
126
keywords = ["byte", "byte-size", "utility", "human-readable", "format"]
7+
categories = ["development-tools", "filesystem"]
8+
repository = "https://github.com/hyunsik/bytesize"
139
license = "Apache-2.0"
10+
edition = "2021"
11+
rust-version = "1.65"
1412

1513
[dependencies]
1614
arbitrary = { version = "1", features = ["derive"], optional = true }

Makefile

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

0 commit comments

Comments
 (0)