Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ckc3b committed Dec 20, 2024
0 parents commit 4e4c87e
Show file tree
Hide file tree
Showing 325 changed files with 16,914 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @rust-embedded/resources
166 changes: 166 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
name: CI

on:
push: # Run CI for all branches except GitHub merge queue tmp branches
branches-ignore:
- "gh-readonly-queue/**"
pull_request: # Run CI for PRs on any branch
merge_group: # Run CI for the GitHub merge queue

jobs:
# Check build succeeds for each f3discovery chapter containing example code.
build-f3discovery-chapter:
runs-on: ubuntu-20.04
strategy:
matrix:
chapter:
- 05-led-roulette
- 06-hello-world
- 07-registers
- 08-leds-again
- 09-clocks-and-timers
- 11-usart
- 14-i2c
- 15-led-compass
- 16-punch-o-meter
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: thumbv7em-none-eabihf
- name: Build chapter
working-directory: f3discovery/src/${{ matrix.chapter }}
run: cargo build --target thumbv7em-none-eabihf
- name: Build chapter examples
working-directory: f3discovery/src/${{ matrix.chapter }}
run: cargo build --target thumbv7em-none-eabihf --examples

# Check build succeeds for f3discovery docs.
build-f3discovery-doc:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: thumbv7em-none-eabihf
- name: Build docs
run: cargo doc --target thumbv7em-none-eabihf
working-directory: f3discovery

# Check a build succeeds for each microbit chapter that contains example code.
build-microbit-chapter:
runs-on: ubuntu-20.04
strategy:
matrix:
chapter:
- 05-led-roulette
- 07-uart
- 08-i2c
- 09-led-compass
- 10-punch-o-meter
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: thumbv6m-none-eabi
- run: rustup target add thumbv7em-none-eabihf
- name: Build chapter micro:bit v1
working-directory: microbit/src/${{ matrix.chapter }}
run: cargo build --features v1 --target thumbv6m-none-eabi
- name: Build chapter micro:bit v2
working-directory: microbit/src/${{ matrix.chapter }}
run: cargo build --features v2 --target thumbv7em-none-eabihf

# Check build succeeds for microbit docs.
build-microbit-doc:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: thumbv6m-none-eabi
- run: rustup target add thumbv7em-none-eabihf
- name: Build docs for micro:bit v1
run: cargo doc --features v1 --target thumbv6m-none-eabi
working-directory: microbit
- name: Build docs for micro:bit v2
run: cargo doc --features v2 --target thumbv7em-none-eabihf
working-directory: microbit

# Build the book HTML itself and optionally publish it.
build-book:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: thumbv7em-none-eabihf
- run: rustup target add thumbv6m-none-eabi

- name: Install Python dependencies
run: |
pip3 install --user python-dateutil linkchecker
- name: Put pip binary directory into path
run: echo "~/.local/bin" >> $GITHUB_PATH

- name: Cache Cargo installed binaries
uses: actions/cache@v1
id: cache-cargo
with:
path: ~/cargo-bin
key: cache-cargo
- name: Install mdbook
if: steps.cache-cargo.outputs.cache-hit != 'true'
uses: actions-rs/[email protected]
with:
crate: mdbook
version: latest
- name: Copy mdbook to cache directory
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: |
mkdir ~/cargo-bin
cp ~/.cargo/bin/mdbook ~/cargo-bin
- name: Put new cargo binary directory into path
run: echo "~/cargo-bin" >> $GITHUB_PATH

- name: Build f3discovery book
working-directory: f3discovery
run: mkdir target && mdbook build
- name: Check microbit links
working-directory: f3discovery
run: linkchecker --ignore-url "print.html" book

- name: Build microbit book
working-directory: microbit
run: mkdir target && mdbook build
- name: Check microbit links
working-directory: microbit
run: linkchecker --ignore-url "print.html" book

- name: Build front page
run: mdbook build
- name: Check links
run: linkchecker book

- name: Collect books
run: |
mv f3discovery/book book/f3discovery
mv microbit/book book/microbit
- name: Deploy book
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: book
force_orphan: true
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.org
.#*
.gdb_history
/template
Cargo.lock
book/
target/
/.idea
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"rust-analyzer.cargo.features": "all"
}
37 changes: 37 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# The Rust Code of Conduct

## Conduct

**Contact**: [Resources team][team]

* We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic.
* On IRC, please avoid using overtly sexual nicknames or other nicknames that might detract from a friendly, safe and welcoming environment for all.
* Please be kind and courteous. There's no need to be mean or rude.
* Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
* Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
* We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term "harassment" as including the definition in the [Citizen Code of Conduct](http://citizencodeofconduct.org/); if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don't tolerate behavior that excludes people in socially marginalized groups.
* Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or any of the [Resources team][team] immediately. Whether you're a regular contributor or a newcomer, we care about making this community a safe place for you and we've got your back.
* Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome.

## Moderation

These are the policies for upholding our community's standards of conduct.

1. Remarks that violate the Rust standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.)
2. Remarks that moderators find inappropriate, whether listed in the code of conduct or not, are also not allowed.
3. Moderators will first respond to such remarks with a warning.
4. If the warning is unheeded, the user will be "kicked," i.e., kicked out of the communication channel to cool off.
5. If the user comes back and continues to make trouble, they will be banned, i.e., indefinitely excluded.
6. Moderators may choose at their discretion to un-ban the user if it was a first offense and they offer the offended party a genuine apology.
7. If a moderator bans someone and you think it was unjustified, please take it up with that moderator, or with a different moderator, **in private**. Complaints about bans in-channel are not allowed.
8. Moderators are held to a higher standard than other community members. If a moderator creates an inappropriate situation, they should expect less leeway than others.

In the Rust community we strive to go the extra step to look out for each other. Don't just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if they're off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely.

And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could've communicated better — remember that it's your responsibility to make your fellow Rustaceans comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.

The enforcement policies listed above apply to all official embedded WG venues; including official IRC channels (#rust-embedded); GitHub repositories under rust-embedded; and all forums under rust-embedded.org (forum.rust-embedded.org).

*Adapted from the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](https://www.contributor-covenant.org/version/1/3/0/).*

[team]: https://github.com/rust-embedded/wg#the-resources-team
Loading

0 comments on commit 4e4c87e

Please sign in to comment.