Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add simple contribution notes #3

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 59 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
CARGO_TERM_VERBOSE: 'true'
RUSTFLAGS: -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort
RUSTDOCFLAGS: -Cpanic=abort

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
# - stable
# - beta
- nightly
steps:
- name: Checkout
Expand All @@ -30,11 +32,63 @@ jobs:
# uses: obi1kenobi/cargo-semver-checks-action@v2

- name: Install Rust
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true

- name: Cache dependencies
uses: actions/cache@v2
env:
cache-name: cache-dependencies
with:
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
target
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }}

- name: Build
run: cargo build --verbose

- name: Test
run: cargo test --verbose
# if: matrix.toolchain == 'nightly'
run: cargo test -- -Z unstable-options --format json --report-time | tee test_results_debug.json
env: # See https://github.com/johnterickson/cargo2junit/issues/79
RUSTC_BOOTSTRAP: 1

- name: Build Release
run: cargo build --release --verbose

- name: Test release
# if: matrix.toolchain == 'nightly'
run: cargo test --release -- -Z unstable-options --format json --report-time | tee test_results_release.json
env: # See https://github.com/johnterickson/cargo2junit/issues/79
RUSTC_BOOTSTRAP: 1

- name: Generate test result and coverage report
run: |
cargo install cargo2junit grcov;
cargo test $CARGO_OPTIONS -- -Z unstable-options --format json | cargo2junit > results.xml;
zip -0 ccov.zip `find . \( -name "zigbee-rs*.gc*" \) -print`;
grcov ccov.zip -s . -t lcov --llvm --ignore-not-existing --ignore "/*" --ignore "tests/*" -o lcov.info;

- name: Upload test results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
check_name: Test Results
github_token: ${{ secrets.GITHUB_TOKEN }}
files: results.xml

- name: Publish Test Report Release
uses: mikepenz/action-junit-report@v3
if: always()
with:
comment: true
report_paths: 'test_results_release.xml'
check_title_template: ${{ matrix.name }} release

50 changes: 50 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Welcome to ZigBee in Rust

This is a **FOSS** (free and open-source software) and lives from contributions of the community.

There are many ways to contribute:

* 📣 Spread the project or its apps to the world
* ✍️ Writing tutorials and blog posts
* 📝 Create or update the documentation
* 🐛 Submit bug reports
* 💡 Adding ideas and feature requests to Discussions
* 👩‍🎨 Create designs or UX flows
* 🧑‍💻 Contribute code or review PRs


## 📜 Ground Rules

A community like this should be **open**, **considerate** and **respectful**.

Behaviours that reinforce these values contribute to a positive environment, and include:

* **Being open**. Members of the community are open to collaboration.
* **Focusing on what is best for the community**. We're respectful of the processes set forth in the community, and we work within them.
* **Acknowledging time and effort**. We're respectful and thoughtful when addressing the efforts of others, keeping in mind that often times the labor was completed simply for the good of the community.
* **Being respectful of differing viewpoints and experiences**. We're receptive to constructive comments and criticism, as the experiences and skill sets of other members contribute to the whole of our efforts.
* **Showing empathy towards other community members**. We're attentive in our communications, whether in person or online, and we're tactful when approaching differing views.
* **Being considerate**. Members of the community are considerate of their peers.
* **Being respectful**. We're respectful of others, their positions, their skills, their commitments, and their efforts.
* **Gracefully accepting constructive criticism**. When we disagree, we are courteous in raising our issues.
* **Using welcoming and inclusive language**. We're accepting of all who wish to take part in our activities, fostering an environment where anyone can participate and everyone can make a difference.


## 🧑‍💻 Code Contribution

To contribute code to the repository, you don't need any permissions.
First start by forking the repository, clone and checkout your clone and start coding.
When you're happy with your changes, create Atomic commits on a **new feature branch** and push it to ***your*** fork.

Atomic commits will make it easier to track down regressions. Also, it enables the ability to cherry-pick or revert a change if needed.

1. Fork it (https://github.com/thebino/zigbee-rs/fork)
2. Create a new feature branch (`git checkout -b feature/fooBar`)
3. Commit your changes (`git commit -am 'Add some fooBar'`)
4. Push to the branch (`git push origin feature/fooBar`)
5. Create a new Pull Request

## 💾 Technology

The project is written in [Rust](https://rust-lang.org/) and using `no_std`

15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![GitHub contributors](https://img.shields.io/github/contributors/thebino/zigbee-rs?color=success&style=for-the-badge)](https://github.com/thebino/zigbee-rs/graphs/contributors)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/thebino/zigbee-rs/ci.yaml?style=for-the-badge)
![ZigBee](https://img.shields.io/badge/zigbee-22.1.0-blue?color=4285F4&logo=zigbee&style=for-the-badge)
![Rust](https://img.shields.io/badge/rust-2021-orange?color=E45928&logo=rust&style=for-the-badge)
![Rust](https://img.shields.io/badge/rust-2018-orange?color=E45928&logo=rust&style=for-the-badge)

The ZigBee protocol stack to integrate ZigBee communication into an application.

Expand All @@ -16,3 +16,16 @@ It enables these devices to connect and communicate with each other, allowing fo
<span>Outline of the ZigBee Stack Architecture</span>
</p>

## 🏛️ License

Licensed under either of:

- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

## 🧩 Contribution

This is a free and open project and lives from contributions of the community.

See our [Contribution Guide](CONTRIBUTING.md)

13 changes: 12 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@
//!
//! ZigBee is a protocol stack based on the ZigBee specification 22 1.0
//!
mod lib {
pub fn add(a: i32, b: i32) -> i32 {
a + b
}

#[cfg(test)]
mod tests {
// Note this useful idiom: importing names from outer (for mod tests) scope.
use super::*;

#[test]
fn test_add() {
assert_eq!(add(1, 2), 3);
}
}

Loading