Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into upstream/merge
Browse files Browse the repository at this point in the history
  • Loading branch information
tomoyuki-nakabayashi committed Jan 16, 2022
2 parents 690ce95 + 6e5f556 commit a9866f9
Show file tree
Hide file tree
Showing 334 changed files with 7,018 additions and 1,116 deletions.
20 changes: 19 additions & 1 deletion .github/bors.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
block_labels = ["needs-decision"]
delete_merged_branches = true
required_approvals = 1
status = ["continuous-integration/travis-ci/push"]
status = [
"build-book",
"build-f3discovery-doc",
"build-f3discovery-chapter (05-led-roulette)",
"build-f3discovery-chapter (06-hello-world)",
"build-f3discovery-chapter (07-registers)",
"build-f3discovery-chapter (08-leds-again)",
"build-f3discovery-chapter (09-clocks-and-timers)",
"build-f3discovery-chapter (11-usart)",
"build-f3discovery-chapter (14-i2c)",
"build-f3discovery-chapter (15-led-compass)",
"build-f3discovery-chapter (16-punch-o-meter)",
"build-microbit-doc",
"build-microbit-chapter (05-led-roulette)",
"build-microbit-chapter (07-uart)",
"build-microbit-chapter (08-i2c)",
"build-microbit-chapter (09-led-compass)",
"build-microbit-chapter (10-punch-o-meter)",
]
164 changes: 164 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
name: CI

on:
push:
branches: [ staging, trying, master ]
pull_request:

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
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,31 @@
# `Discovery`

> Discover the world of microcontrollers through Rust
Discover the world of microcontrollers through [Rust](https://www.rust-lang.org/)!

There are currently two versions of this book. Both of them provide an
introduction to microcontrollers and how to use Rust with them.
The first is older and uses an F3 Discovery circuit board, while
the second is newer and uses a micro:bit circuit board instead.

- Read the newer book, using a micro:bit:
https://docs.rust-embedded.org/discovery/microbit
- Read the older book, using an F3 discovery board:
https://docs.rust-embedded.org/discovery/f3discovery
- Start working on the examples from this repository
- You've got questions?
- Have a look at our [discussions section on
GitHub](https://github.com/rust-embedded/discovery/discussions)
- Maybe it has already been answered
- If not, start a new discussion
- You've found an issue?
- Have a look at our [issues on
GitHub](https://github.com/rust-embedded/discovery/issues)
- Maybe there is already a workaround
- If not, please open a new one - or even better - a [pull
request](https://github.com/rust-embedded/discovery/pulls) for solving
it
- Have fun and enjoy!

This project is developed and maintained by the [Resources team][team].

Expand Down
21 changes: 0 additions & 21 deletions ci/after-success.sh

This file was deleted.

23 changes: 0 additions & 23 deletions ci/install.sh

This file was deleted.

69 changes: 0 additions & 69 deletions ci/script.sh

This file was deleted.

File renamed without changes.
9 changes: 9 additions & 0 deletions f3discovery/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[book]
title = "Discovery"
description = "Discover the world of microcontrollers through Rust"
author = "Rust Embedded Resources Team"
language = "en"

[output.html]
additional-css = ["custom.css"]
git-repository-url = "https://github.com/rust-embedded/discovery/"
6 changes: 6 additions & 0 deletions f3discovery/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* Add this style to the image if it's unreadable
when the dark theme is applied */
img.white_bg {
background-color: white;
padding: 1em;
}
11 changes: 11 additions & 0 deletions f3discovery/src/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[target.thumbv7em-none-eabihf]
runner = "arm-none-eabi-gdb -q"
# runner = "gdb-multiarch -q"
# runner = "gdb -q"
rustflags = [
"-C", "link-arg=-Tlink.x",
]

[build]
target = "thumbv7em-none-eabihf"

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,4 @@ better off starting with the [quickstart] project template.

異なる開発ボードを持っていたり、自分を初心者とは考えていない場合は、[quickstart]プロジェクトテンプレートから始めた方が良いでしょう。

[quickstart]: https://docs.rs/cortex-m-quickstart
[quickstart]: https://rust-embedded.github.io/cortex-m-quickstart/cortex_m_quickstart/
Loading

0 comments on commit a9866f9

Please sign in to comment.