Skip to content

Commit eedef6d

Browse files
authored
refactor: update project layout (#23)
* refactor: update project layout * fix no_std * add release.toml * update readme
1 parent fb83245 commit eedef6d

20 files changed

Lines changed: 394 additions & 412 deletions

.github/codecov.yml

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

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ updates:
33
- package-ecosystem: "cargo"
44
directory: "/"
55
schedule:
6-
interval: "daily"
6+
interval: "monthly"
77

88
- package-ecosystem: "github-actions"
99
directory: "/"
1010
schedule:
11-
interval: "daily"
11+
interval: "monthly"

.github/workflows/build.yml

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

.github/workflows/ci.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- "v0.*.x" # v0.1.x or v0.20.x
8+
- "v[1-9]*.x" # v1.x or v20.x
9+
pull_request:
10+
branches:
11+
- main
12+
- "v0.*.x" # v0.1.x or v0.20.x
13+
- "v[1-9]*.x" # v1.x or v20.x
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
env:
20+
RUSTFLAGS: -D warnings
21+
CARGO_TERM_COLOR: always
22+
CARGO_INCREMENTAL: 0
23+
TAPLO_CLI_VERSION: 0.10.0
24+
25+
jobs:
26+
check-format:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v6
30+
31+
- name: Cache taplo-cli
32+
id: cache-taplo
33+
uses: actions/cache@v5
34+
with:
35+
path: ~/.cargo/bin/taplo
36+
key: ${{ runner.os }}-taplo-${{ env.TAPLO_CLI_VERSION }}
37+
38+
- name: Install taplo-cli if not cached
39+
if: steps.cache-taplo.outputs.cache-hit != 'true'
40+
shell: bash
41+
run: cargo install taplo-cli@${TAPLO_CLI_VERSION} --locked
42+
43+
- name: Run taplo fmt
44+
run: taplo fmt --check
45+
46+
- name: Run cargo fmt
47+
run: cargo fmt --all -- --check
48+
49+
check-clippy:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v6
53+
- uses: swatinem/rust-cache@v2
54+
55+
- name: Run cargo clippy
56+
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
57+
58+
build-default-features:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v6
62+
- uses: swatinem/rust-cache@v2
63+
- run: cargo build
64+
65+
build-no-default-features:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v6
69+
- uses: swatinem/rust-cache@v2
70+
- run: cargo build --no-default-features
71+
72+
check-msrv:
73+
runs-on: ubuntu-latest
74+
env:
75+
MSRV: 1.85.0
76+
steps:
77+
- uses: actions/checkout@v6
78+
79+
- name: Setup MSRV
80+
run: rustup toolchain install ${MSRV} --no-self-update
81+
82+
- name: Check code
83+
run: cargo +${MSRV} check --all-features
84+
85+
check-docs:
86+
runs-on: ubuntu-latest
87+
steps:
88+
- uses: actions/checkout@v6
89+
- uses: swatinem/rust-cache@v2
90+
91+
- name: Generate docs
92+
run: cargo doc --no-deps --lib --all-features
93+
94+
run-tests:
95+
runs-on: ${{ matrix.os }}
96+
strategy:
97+
fail-fast: false
98+
matrix:
99+
os: [ubuntu-latest, windows-latest, macos-latest]
100+
steps:
101+
- uses: actions/checkout@v6
102+
103+
- name: Rust Cache
104+
uses: swatinem/rust-cache@v2
105+
with:
106+
shared-key: ${{ matrix.os }}
107+
108+
- name: Run tests
109+
run: cargo test --workspace --all-features
110+
env:
111+
RUST_BACKTRACE: 1

Cargo.toml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
1+
[workspace]
2+
members = [".", "cmd"]
3+
resolver = "3"
4+
5+
[workspace.package]
6+
edition = "2024"
7+
rust-version = "1.85.0"
8+
license = "Apache-2.0"
9+
homepage = "https://github.com/koushiro/flvparse"
10+
repository = "https://github.com/koushiro/flvparse"
11+
112
[package]
213
name = "flvparse"
314
version = "0.1.0"
415
authors = ["koushiro <koushiro.cqx@gmail.com>"]
5-
edition = "2018"
16+
edition.workspace = true
17+
rust-version.workspace = true
18+
license.workspace = true
19+
homepage.workspace = true
20+
repository.workspace = true
21+
22+
description = "A FLV format parsing library written in Rust"
623
readme = "README.md"
7-
license = "MIT/Apache-2.0"
824
documentation = "https://docs.rs/flvparse"
9-
repository = "https://github.com/koushiro/flvparse"
10-
description = "A FLV format parsing library written in Rust"
1125
keywords = ["flv", "parse", "nom"]
12-
exclude = [
13-
".github",
14-
"assets",
15-
"cmd",
16-
"tests"
17-
]
26+
exclude = ["assets", "cmd", "tests"]
1827

1928
[lib]
2029
name = "flvparse"
2130
path = "src/lib.rs"
2231

2332
[features]
2433
default = ["std"]
25-
alloc = ["nom/alloc"]
2634
std = ["nom/std"]
2735

2836
[dependencies]
29-
nom = { version = "6.1", default-features = false }
37+
nom = { version = "6.1", default-features = false, features = ["alloc"] }
File renamed without changes.

LICENSE-MIT

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

0 commit comments

Comments
 (0)