diff options
| author | Quentin Smith <[email protected]> | 2023-07-17 21:31:43 -0400 |
|---|---|---|
| committer | Quentin Smith <[email protected]> | 2023-07-17 21:31:43 -0400 |
| commit | 6f02403184eb7fb7990fb88fc9df9c4328a690a3 (patch) | |
| tree | 748f510e190bb2724750507a6e69ed1a8e08cb20 /.github | |
| parent | d896f80405aa8963877049ed999e4aba25d6e2bb (diff) | |
| parent | 6b5df4523aa1c4902f02e803450ae4b418e0e3ca (diff) | |
Merge remote-tracking branch 'origin/main' into nrf-pdm
Diffstat (limited to '.github')
| -rwxr-xr-x | .github/ci/build-stable.sh | 16 | ||||
| -rwxr-xr-x | .github/ci/build.sh | 19 | ||||
| -rwxr-xr-x | .github/ci/doc.sh | 45 | ||||
| -rwxr-xr-x | .github/ci/test.sh | 30 | ||||
| -rw-r--r-- | .github/workflows/rust.yml | 72 |
5 files changed, 110 insertions, 72 deletions
diff --git a/.github/ci/build-stable.sh b/.github/ci/build-stable.sh new file mode 100755 index 000000000..0dadd6102 --- /dev/null +++ b/.github/ci/build-stable.sh | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | ## on push branch~=gh-readonly-queue/main/.* | ||
| 3 | ## on pull_request | ||
| 4 | |||
| 5 | set -euo pipefail | ||
| 6 | |||
| 7 | export RUSTUP_HOME=/ci/cache/rustup | ||
| 8 | export CARGO_HOME=/ci/cache/cargo | ||
| 9 | export CARGO_TARGET_DIR=/ci/cache/target | ||
| 10 | |||
| 11 | hashtime restore /ci/cache/filetime.json || true | ||
| 12 | hashtime save /ci/cache/filetime.json | ||
| 13 | |||
| 14 | sed -i 's/channel.*/channel = "stable"/g' rust-toolchain.toml | ||
| 15 | |||
| 16 | ./ci_stable.sh | ||
diff --git a/.github/ci/build.sh b/.github/ci/build.sh new file mode 100755 index 000000000..30ca1e6f0 --- /dev/null +++ b/.github/ci/build.sh | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | ## on push branch~=gh-readonly-queue/main/.* | ||
| 3 | ## on pull_request | ||
| 4 | |||
| 5 | set -euo pipefail | ||
| 6 | |||
| 7 | export RUSTUP_HOME=/ci/cache/rustup | ||
| 8 | export CARGO_HOME=/ci/cache/cargo | ||
| 9 | export CARGO_TARGET_DIR=/ci/cache/target | ||
| 10 | if [ -f /ci/secrets/teleprobe-token.txt ]; then | ||
| 11 | echo Got teleprobe token! | ||
| 12 | export TELEPROBE_HOST=https://teleprobe.embassy.dev | ||
| 13 | export TELEPROBE_TOKEN=$(cat /ci/secrets/teleprobe-token.txt) | ||
| 14 | fi | ||
| 15 | |||
| 16 | hashtime restore /ci/cache/filetime.json || true | ||
| 17 | hashtime save /ci/cache/filetime.json | ||
| 18 | |||
| 19 | ./ci.sh | ||
diff --git a/.github/ci/doc.sh b/.github/ci/doc.sh new file mode 100755 index 000000000..9e9c78a42 --- /dev/null +++ b/.github/ci/doc.sh | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | ## on push branch=main | ||
| 3 | |||
| 4 | set -euo pipefail | ||
| 5 | |||
| 6 | export RUSTUP_HOME=/ci/cache/rustup | ||
| 7 | export CARGO_HOME=/ci/cache/cargo | ||
| 8 | export CARGO_TARGET_DIR=/ci/cache/target | ||
| 9 | export BUILDER_THREADS=4 | ||
| 10 | export BUILDER_COMPRESS=true | ||
| 11 | |||
| 12 | # force rustup to download the toolchain before starting building. | ||
| 13 | # Otherwise, the docs builder is running multiple instances of cargo rustdoc concurrently. | ||
| 14 | # They all see the toolchain is not installed and try to install it in parallel | ||
| 15 | # which makes rustup very sad | ||
| 16 | rustc --version > /dev/null | ||
| 17 | |||
| 18 | docserver-builder -i ./embassy-stm32 -o webroot/crates/embassy-stm32/git.zup | ||
| 19 | docserver-builder -i ./embassy-boot/boot -o webroot/crates/embassy-boot/git.zup | ||
| 20 | docserver-builder -i ./embassy-boot/nrf -o webroot/crates/embassy-boot-nrf/git.zup | ||
| 21 | docserver-builder -i ./embassy-boot/rp -o webroot/crates/embassy-boot-rp/git.zup | ||
| 22 | docserver-builder -i ./embassy-boot/stm32 -o webroot/crates/embassy-boot-stm32/git.zup | ||
| 23 | docserver-builder -i ./embassy-embedded-hal -o webroot/crates/embassy-embedded-hal/git.zup | ||
| 24 | docserver-builder -i ./embassy-executor -o webroot/crates/embassy-executor/git.zup | ||
| 25 | docserver-builder -i ./embassy-futures -o webroot/crates/embassy-futures/git.zup | ||
| 26 | docserver-builder -i ./embassy-lora -o webroot/crates/embassy-lora/git.zup | ||
| 27 | docserver-builder -i ./embassy-net -o webroot/crates/embassy-net/git.zup | ||
| 28 | docserver-builder -i ./embassy-net-driver -o webroot/crates/embassy-net-driver/git.zup | ||
| 29 | docserver-builder -i ./embassy-net-driver-channel -o webroot/crates/embassy-net-driver-channel/git.zup | ||
| 30 | docserver-builder -i ./embassy-nrf -o webroot/crates/embassy-nrf/git.zup | ||
| 31 | docserver-builder -i ./embassy-rp -o webroot/crates/embassy-rp/git.zup | ||
| 32 | docserver-builder -i ./embassy-sync -o webroot/crates/embassy-sync/git.zup | ||
| 33 | docserver-builder -i ./embassy-time -o webroot/crates/embassy-time/git.zup | ||
| 34 | docserver-builder -i ./embassy-usb -o webroot/crates/embassy-usb/git.zup | ||
| 35 | docserver-builder -i ./embassy-usb-driver -o webroot/crates/embassy-usb-driver/git.zup | ||
| 36 | docserver-builder -i ./embassy-usb-logger -o webroot/crates/embassy-usb-logger/git.zup | ||
| 37 | docserver-builder -i ./cyw43 -o webroot/crates/cyw43/git.zup | ||
| 38 | docserver-builder -i ./cyw43-pio -o webroot/crates/cyw43-pio/git.zup | ||
| 39 | docserver-builder -i ./embassy-net-w5500 -o webroot/crates/embassy-net-w5500/git.zup | ||
| 40 | docserver-builder -i ./embassy-stm32-wpan -o webroot/crates/embassy-stm32-wpan/git.zup --output-static webroot/static | ||
| 41 | |||
| 42 | export KUBECONFIG=/ci/secrets/kubeconfig.yml | ||
| 43 | POD=$(kubectl -n embassy get po -l app=docserver -o jsonpath={.items[0].metadata.name}) | ||
| 44 | kubectl cp webroot/crates $POD:/data | ||
| 45 | kubectl cp webroot/static $POD:/data \ No newline at end of file | ||
diff --git a/.github/ci/test.sh b/.github/ci/test.sh new file mode 100755 index 000000000..d014e4bd7 --- /dev/null +++ b/.github/ci/test.sh | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | ## on push branch~=gh-readonly-queue/main/.* | ||
| 3 | ## on pull_request | ||
| 4 | |||
| 5 | set -euo pipefail | ||
| 6 | |||
| 7 | export RUSTUP_HOME=/ci/cache/rustup | ||
| 8 | export CARGO_HOME=/ci/cache/cargo | ||
| 9 | export CARGO_TARGET_DIR=/ci/cache/target | ||
| 10 | |||
| 11 | hashtime restore /ci/cache/filetime.json || true | ||
| 12 | hashtime save /ci/cache/filetime.json | ||
| 13 | |||
| 14 | cargo test --manifest-path ./embassy-sync/Cargo.toml | ||
| 15 | cargo test --manifest-path ./embassy-embedded-hal/Cargo.toml | ||
| 16 | cargo test --manifest-path ./embassy-hal-common/Cargo.toml | ||
| 17 | cargo test --manifest-path ./embassy-time/Cargo.toml --features generic-queue | ||
| 18 | |||
| 19 | cargo test --manifest-path ./embassy-boot/boot/Cargo.toml | ||
| 20 | cargo test --manifest-path ./embassy-boot/boot/Cargo.toml --features nightly | ||
| 21 | cargo test --manifest-path ./embassy-boot/boot/Cargo.toml --features nightly,ed25519-dalek | ||
| 22 | cargo test --manifest-path ./embassy-boot/boot/Cargo.toml --features nightly,ed25519-salty | ||
| 23 | |||
| 24 | cargo test --manifest-path ./embassy-nrf/Cargo.toml --no-default-features --features nightly,nrf52840,time-driver-rtc1,gpiote | ||
| 25 | |||
| 26 | cargo test --manifest-path ./embassy-rp/Cargo.toml --no-default-features --features nightly,time-driver | ||
| 27 | |||
| 28 | cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features nightly,stm32f429vg,exti,time-driver-any,exti | ||
| 29 | cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features nightly,stm32f732ze,exti,time-driver-any,exti | ||
| 30 | cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features nightly,stm32f769ni,exti,time-driver-any,exti | ||
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index d2e8e316b..000000000 --- a/.github/workflows/rust.yml +++ /dev/null | |||
| @@ -1,72 +0,0 @@ | |||
| 1 | name: Rust | ||
| 2 | |||
| 3 | on: | ||
| 4 | push: | ||
| 5 | branches: [staging, trying, master] | ||
| 6 | pull_request: | ||
| 7 | branches: [master] | ||
| 8 | |||
| 9 | env: | ||
| 10 | CARGO_TERM_COLOR: always | ||
| 11 | |||
| 12 | jobs: | ||
| 13 | all: | ||
| 14 | runs-on: ubuntu-20.04 | ||
| 15 | needs: [build-nightly, build-stable, test] | ||
| 16 | steps: | ||
| 17 | - name: Done | ||
| 18 | run: exit 0 | ||
| 19 | build-nightly: | ||
| 20 | runs-on: ubuntu-latest | ||
| 21 | permissions: | ||
| 22 | id-token: write | ||
| 23 | contents: read | ||
| 24 | steps: | ||
| 25 | - uses: actions/checkout@v2 | ||
| 26 | with: | ||
| 27 | submodules: true | ||
| 28 | - name: Cache multiple paths | ||
| 29 | uses: actions/cache@v2 | ||
| 30 | with: | ||
| 31 | path: | | ||
| 32 | ~/.cargo/bin/ | ||
| 33 | ~/.cargo/registry/index/ | ||
| 34 | ~/.cargo/registry/cache/ | ||
| 35 | ~/.cargo/git/db/ | ||
| 36 | target_ci | ||
| 37 | key: rust3-${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }} | ||
| 38 | - name: build | ||
| 39 | run: | | ||
| 40 | curl -L -o /usr/local/bin/cargo-batch https://github.com/embassy-rs/cargo-batch/releases/download/batch-0.3.0/cargo-batch | ||
| 41 | chmod +x /usr/local/bin/cargo-batch | ||
| 42 | ./ci.sh | ||
| 43 | rm -rf target_ci/*{,/release}/{build,deps,.fingerprint}/{lib,}{embassy,stm32}* | ||
| 44 | build-stable: | ||
| 45 | runs-on: ubuntu-latest | ||
| 46 | steps: | ||
| 47 | - uses: actions/checkout@v2 | ||
| 48 | with: | ||
| 49 | submodules: true | ||
| 50 | - name: Cache multiple paths | ||
| 51 | uses: actions/cache@v2 | ||
| 52 | with: | ||
| 53 | path: | | ||
| 54 | ~/.cargo/bin/ | ||
| 55 | ~/.cargo/registry/index/ | ||
| 56 | ~/.cargo/registry/cache/ | ||
| 57 | ~/.cargo/git/db/ | ||
| 58 | target_ci_stable | ||
| 59 | key: rust-stable-${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }} | ||
| 60 | - name: build | ||
| 61 | run: | | ||
| 62 | curl -L -o /usr/local/bin/cargo-batch https://github.com/embassy-rs/cargo-batch/releases/download/batch-0.3.0/cargo-batch | ||
| 63 | chmod +x /usr/local/bin/cargo-batch | ||
| 64 | ./ci_stable.sh | ||
| 65 | rm -rf target_ci_stable/*{,/release}/{build,deps,.fingerprint}/{lib,}{embassy,stm32}* | ||
| 66 | |||
| 67 | test: | ||
| 68 | runs-on: ubuntu-latest | ||
| 69 | steps: | ||
| 70 | - uses: actions/checkout@v2 | ||
| 71 | - name: Test | ||
| 72 | run: cd embassy-sync && cargo test | ||
