Skip to content

Commit 5febca9

Browse files
authored
ci: add templates and ci check #2
2 parents b7eca56 + 028abc6 commit 5febca9

File tree

6 files changed

+325
-1
lines changed

6 files changed

+325
-1
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Bug Report
2+
description: Create a report to help improve zParse
3+
title: "bug: "
4+
labels: ["bug", "triage"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to fill out this bug report!
10+
11+
- type: input
12+
id: version
13+
attributes:
14+
label: Version
15+
description: What version of zParse are you using?
16+
placeholder: "1.0.0"
17+
validations:
18+
required: true
19+
20+
- type: dropdown
21+
id: platform
22+
attributes:
23+
label: Platform
24+
description: What platform are you using?
25+
options:
26+
- Linux
27+
- macOS
28+
- Windows
29+
- Other (specify in description)
30+
validations:
31+
required: true
32+
33+
- type: textarea
34+
id: description
35+
attributes:
36+
label: Describe the bug
37+
description: A clear and concise description of what the bug is.
38+
placeholder: "When I try to parse X, Y happens instead of Z..."
39+
validations:
40+
required: true
41+
42+
- type: textarea
43+
id: reproduction
44+
attributes:
45+
label: To Reproduce
46+
description: Steps to reproduce the behavior
47+
placeholder: |
48+
1. Create a file with content '...'
49+
2. Run command '...'
50+
3. See error
51+
validations:
52+
required: true
53+
54+
- type: textarea
55+
id: example
56+
attributes:
57+
label: Example Code/Input
58+
description: Please provide a minimal example that demonstrates the issue
59+
render: rust
60+
placeholder: |
61+
use zparse::parse_file;
62+
63+
fn main() -> Result<(), Box<dyn std::error::Error>> {
64+
let value = parse_file("config.json")?;
65+
println!("{}", value);
66+
Ok(())
67+
}
68+
validations:
69+
required: true
70+
71+
- type: textarea
72+
id: expected
73+
attributes:
74+
label: Expected behavior
75+
description: A clear and concise description of what you expected to happen.
76+
validations:
77+
required: true
78+
79+
- type: textarea
80+
id: actual
81+
attributes:
82+
label: Actual behavior
83+
description: What actually happened?
84+
placeholder: Include any error messages, stack traces, or unexpected output.
85+
validations:
86+
required: true
87+
88+
- type: textarea
89+
id: additional
90+
attributes:
91+
label: Additional context
92+
description: Add any other context about the problem here
93+
validations:
94+
required: false
95+
96+
- type: checkboxes
97+
id: terms
98+
attributes:
99+
label: Code of Conduct
100+
description: By submitting this issue, you agree to follow our Code of Conduct
101+
options:
102+
- label: I agree to follow this project's Code of Conduct
103+
required: true
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Feature Request
2+
description: Suggest an idea for zParse
3+
title: "feat: "
4+
labels: ["enhancement"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to suggest a new feature!
10+
11+
- type: textarea
12+
id: problem
13+
attributes:
14+
label: Is your feature request related to a problem?
15+
description: A clear and concise description of what the problem is.
16+
placeholder: I'm always frustrated when [...]
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: solution
22+
attributes:
23+
label: Describe the solution you'd like
24+
description: A clear and concise description of what you want to happen.
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: example
30+
attributes:
31+
label: Example Implementation
32+
description: If you have an idea of how this might be implemented, share it here
33+
render: rust
34+
placeholder: |
35+
// Example API usage or implementation
36+
use zparse::SomeNewFeature;
37+
38+
fn example() {
39+
// Your example code here
40+
}
41+
validations:
42+
required: false
43+
44+
- type: textarea
45+
id: context
46+
attributes:
47+
label: Additional context
48+
description: Add any other context or screenshots about the feature request here.
49+
validations:
50+
required: false
51+
52+
- type: dropdown
53+
id: priority
54+
attributes:
55+
label: Priority
56+
description: How important is this feature to you?
57+
options:
58+
- Nice to have
59+
- Important
60+
- Critical
61+
validations:
62+
required: true
63+
64+
- type: checkboxes
65+
id: terms
66+
attributes:
67+
label: Code of Conduct
68+
description: By submitting this issue, you agree to follow our Code of Conduct
69+
options:
70+
- label: I agree to follow this project's Code of Conduct
71+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## Type of Change
2+
3+
<!-- Put an `x` in the boxes that apply -->
4+
5+
- [ ] Bugfix
6+
- [ ] New feature
7+
- [ ] Enhancement
8+
- [ ] Refactoring
9+
- [ ] Dependency updates
10+
- [ ] Documentation
11+
- [ ] CI/CD
12+
13+
## Description
14+
15+
<!-- Describe your changes in detail -->
16+
17+
## Context
18+
19+
<!--
20+
Why is this change required? What problem does it solve?
21+
If it fixes an open issue, please link to the issue here.
22+
23+
If you don't have an issue, we'd recommend starting with one first so the PR
24+
can focus on the implementation (unless it is an obvious bug or documentation fix
25+
that will have little conversation).
26+
-->
27+
28+
## How did you test it?
29+
30+
<!--
31+
Did you write an integration/unit/API test to verify the code changes?
32+
Or did you test this change manually (provide relevant screenshots)?
33+
-->
34+
35+
## Checklist
36+
37+
<!-- Put an `x` in the boxes that apply -->
38+
39+
- [ ] I formatted the code `cargo +nightly fmt --all`
40+
- [ ] I addressed lints thrown by `cargo clippy`
41+
- [ ] I reviewed the submitted code
42+
- [ ] I added unit tests for my changes where possible

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
# Enable version updates for npm
9+
- package-ecosystem: "cargo"
10+
# Look for `Cargo.toml` and `Cargo.lock` files in the `root` directory
11+
directory: "/"
12+
# Check the Cargo for updates weekly
13+
schedule:
14+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: CI-push
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
merge_group:
8+
types:
9+
- checks_requested
10+
pull_request:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
env:
17+
CARGO_INCREMENTAL: 0
18+
CARGO_NET_RETRY: 10
19+
RUSTUP_MAX_RETRIES: 10
20+
RUST_BACKTRACE: short
21+
22+
jobs:
23+
formatting:
24+
name: cargo-fmt
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Install Rust
32+
uses: dtolnay/rust-toolchain@master
33+
with:
34+
toolchain: nightly
35+
components: rustfmt
36+
37+
- name: Check formatting
38+
shell: bash
39+
run: cargo +nightly fmt --all --check
40+
41+
typos:
42+
name: spell-check
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v4
47+
48+
- name: Spell check
49+
uses: crate-ci/typos@master
50+
51+
test:
52+
name: test-${{ matrix.runner }}
53+
runs-on: ${{ matrix.runner }}
54+
timeout-minutes: 30
55+
56+
env:
57+
RUSTFLAGS: "-D warnings"
58+
59+
strategy:
60+
fail-fast: true
61+
matrix:
62+
runner:
63+
- ubuntu-latest
64+
- macos-latest
65+
- windows-latest
66+
67+
steps:
68+
- name: Checkout repository
69+
uses: actions/checkout@v4
70+
71+
- name: Install mold linker
72+
uses: rui314/setup-mold@v1
73+
if: ${{ runner.os == 'Linux' }}
74+
with:
75+
make-default: true
76+
77+
- name: Install Rust
78+
uses: dtolnay/rust-toolchain@master
79+
with:
80+
toolchain: stable 2 weeks ago
81+
components: clippy
82+
83+
- uses: Swatinem/[email protected]
84+
with:
85+
save-if: ${{ github.event_name == 'push' }}
86+
87+
# Run only zparse package tests, exclude fuzz package completely
88+
- name: Run tests
89+
run: cargo test --all-features --all-targets
90+
91+
- name: Run tests (release)
92+
run: cargo test --release --all-features --all-targets
93+
94+
- name: Run Clippy
95+
run: cargo clippy --all-features --all-targets -- -D warnings

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ pub mod detector;
33
pub mod report;
44
pub mod scanner;
55
pub mod utils;
6-

0 commit comments

Comments
 (0)