Skip to content

Commit

Permalink
ci: split up CI jobs (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede authored Oct 31, 2024
1 parent bf6d7bc commit f26df42
Show file tree
Hide file tree
Showing 9 changed files with 321 additions and 163 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on:
pull_request:
types: [opened, synchronize, reopened]
merge_group:
types: [checks_requested]
push:
branches: [master]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
read_msrv:
name: Read MSRV
uses: actions-rust-lang/msrv/.github/workflows/msrv.yml@v0.1.0

rust:
needs: read_msrv

strategy:
fail-fast: false
matrix:
os:
- { name: Linux, runner: ubuntu-latest }
- { name: macOS, runner: macos-latest }
- { name: Windows, runner: windows-latest }
toolchain:
- { name: stable, version: stable }
- { name: msrv, version: "${{ needs.read_msrv.outputs.msrv }}" }

name: ${{ matrix.os.name }} / ${{ matrix.toolchain.name }}
runs-on: ${{ matrix.os.runner }}

steps:
- uses: actions/checkout@v4

- name: Install Rust (${{ matrix.toolchain.name }})
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
toolchain: ${{ matrix.toolchain.version }}

- name: Install just, nextest
uses: taiki-e/install-action@v2.44.25
with:
tool: just,nextest

- name: Test
run: just test
39 changes: 39 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Coverage

on:
push:
branches: [master]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
components: llvm-tools-preview

- name: Install just & cargo-llvm-cov
uses: taiki-e/install-action@v2.44.5
with:
tool: just,cargo-llvm-cov

- name: Generate code coverage
run: just test-coverage-codecov

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.5.0
with:
files: codecov.json
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
84 changes: 84 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Lint

on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
clippy:
runs-on: ubuntu-latest

permissions:
contents: read
checks: write

steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
components: clippy

- name: Install just, cargo-hack
uses: taiki-e/install-action@v2.44.25
with:
tool: just,cargo-hack

- name: Check with Clippy
run: just clippy

rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
toolchain: nightly
components: rustfmt

- name: Check with Rustfmt
run: cargo fmt -- --check

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
toolchain: nightly
components: rust-docs

- name: Check for broken intra-doc links
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --workspace --no-deps --all-features

sorted-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
components: clippy

- name: Install just, cargo-sort
uses: taiki-e/install-action@v2.44.25
with:
tool: just,cargo-sort

- name: Check dependency requirements are sorted lexicographically
run: cargo sort --workspace --check
70 changes: 0 additions & 70 deletions .github/workflows/rust.yml

This file was deleted.

14 changes: 6 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
[package]
name = "bytesize"
description = "A utility for human-readable bytes representations. Forked from https://github.com/hyunsik/bytesize ."
version = "1.4.0-dev"
description = "A utility for human-readable byte count representations"
version = "1.3.0"
authors = ["Hyunsik Choi <hyunsik.choi@gmail.com>", "MrCroxx <mrcroxx@outlook.com>"]
edition = "2021"

homepage = "https://github.com/hyunsik/bytesize/"
documentation = "https://docs.rs/bytesize/"
repository = "https://github.com/hyunsik/bytesize/"
readme = "README.md"
keywords = ["byte", "byte-size", "utility", "human-readable", "format"]
categories = ["development-tools", "filesystem"]
repository = "https://github.com/hyunsik/bytesize"
license = "Apache-2.0"
edition = "2021"
rust-version = "1.65"

[dependencies]
arbitrary = { version = "1", features = ["derive"], optional = true }
Expand Down
8 changes: 0 additions & 8 deletions Makefile

This file was deleted.

Loading

0 comments on commit f26df42

Please sign in to comment.