Skip to content

Commit

Permalink
Merge pull request #21 from Nukesor/ci
Browse files Browse the repository at this point in the history
add: CI workflows and issue templates
  • Loading branch information
Nukesor authored Nov 28, 2023
2 parents 0a013a3 + a019f53 commit e03997e
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 32 deletions.
77 changes: 77 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Bug Report 🐛
description: Create a report to help improve the project
labels: ["t: bug"]
title: "[Bug]"

body:
- type: markdown
attributes:
value: |
Please take the time to fill out all relevant the fields below.
- type: textarea
id: description-of-bug
attributes:
label: Describe the bug
description: A clear and concise description of the bug.
placeholder: |
Description goes here :)
validations:
required: true

- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to reproduce
description: |
Please add a code example on how to trigger the bug.
Or even better, a link to a repository with a minimal reproducible setup to reproduce the bug.
placeholder: |
```
use libwifi::*;
```
The import doesn't work!
validations:
required: true

- type: textarea
id: debug-output
attributes:
label: Logs (if applicable)
description: |
This is mostly important for crashes or panics.
Logs helps me to debug a problem if the bug is something that's not clearly visible.
placeholder: |
```
Some log output here
```
validations:
required: false

- type: input
id: operating-system
attributes:
label: Operating system
description: The operating system you're using.
placeholder: iOS 8 / Windows 10 / Ubuntu 22.04
validations:
required: true

- type: input
id: version
attributes:
label: libwifi version
description: The current version you're using.
placeholder: v0.1.0
validations:
required: true

- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context about the problem here.
placeholder: |
Anything else you want to add.
validations:
required: false
56 changes: 56 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Feature request
description: Suggest an idea for this project
labels: ["t: feature"]

body:
- type: markdown
attributes:
value: |
Please take the time to fill out all relevant the fields below.
- type: textarea
id: feature
attributes:
label: A detailed description of the feature you would like to see added.
description: |
Explain how that feature would look like and how it should behave.
placeholder: |
Description
validations:
required: true

- type: textarea
id: user-story
attributes:
label: Explain your usecase of the requested feature
description: |
I need to know what a feature is going to be used for, before I can decide if and how it's going to be implemented.
The more information you provide, the better I understand your problem ;).
placeholder: |
User story
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives
description: |
If your problem can be solved in multiple ways, I would like to hear the possible alternatives you've considered.
Some problems really don't have any feasible alternatives, in that case don't bother answering this question :)
placeholder: |
Alternatives
validations:
required: false

- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context about the problem here.
placeholder: |
Anything else you want to add, such as sketches, example code, etc.
validations:
required: false
7 changes: 4 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
version: 2
updates:
- package-ecosystem: cargo
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
- package-ecosystem: github-actions

- package-ecosystem: cargo
directory: "/"
schedule:
interval: daily
interval: weekly
16 changes: 8 additions & 8 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ on:
push:
branches: [main]
paths:
- '.github/**/*'
- '.github/workflows/coverage.yml'
- '**.rs'
- 'Cargo.toml'
- 'Cargo.lock'
pull_request:
branches: [main]
paths:
- '.github/**/*'
- '.github/workflows/coverage.yml'
- '**.rs'
- 'Cargo.toml'
- 'Cargo.lock'

jobs:
coverage:
name: Create coverage statistics
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
components: llvm-tools-preview

- name: Install cargo-llvm-cov
Expand All @@ -40,4 +40,4 @@ jobs:
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: true
fail_ci_if_error: false
2 changes: 1 addition & 1 deletion .github/workflows/style.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Code Style
name: Lint

on:
push:
Expand Down
46 changes: 27 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,51 @@ on:
push:
branches: [main]
paths:
- '.github/**/*'
- '**.rs'
- 'Cargo.toml'
- ".github/workflows/test.yml"
- "**.rs"
- "Cargo.toml"
- "Cargo.lock"
pull_request:
branches: [main]
paths:
- '.github/**/*'
- '**.rs'
- 'Cargo.toml'
- ".github/workflows/test.yml"
- "**.rs"
- "Cargo.toml"
- "Cargo.lock"

jobs:
test:
name: Tests on ${{ matrix.os }} for ${{ matrix.toolchain }}
name: Test target ${{ matrix.target }} on ${{ matrix.os }} for ${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolchain: [stable]
target:
- x86_64-unknown-linux-gnu
- x86_64-pc-windows-msvc
- x86_64-apple-darwin
toolchain: [stable, nightly, "1.70"]
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: x86_64-apple-darwin
os: macos-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
targets: ${{ matrix.target }}
toolchain: ${{ matrix.toolchain }}
override: true
components: rustfmt, clippy

- name: cargo build
uses: actions-rs/cargo@v1
with:
command: build
run: cargo build --target=${{ matrix.target }}

- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
run: cargo test --target=${{ matrix.target }}
2 changes: 1 addition & 1 deletion libwifi/src/parsers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn flag_is_set(data: u8, bit: usize) -> bool {
}
}

pub(self) fn flag((input, bit_offset): (&[u8], usize)) -> IResult<(&[u8], usize), bool> {
fn flag((input, bit_offset): (&[u8], usize)) -> IResult<(&[u8], usize), bool> {
if input.is_empty() {
return Err(nom::Err::Incomplete(Needed::new(1)));
}
Expand Down

0 comments on commit e03997e

Please sign in to comment.