aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorQuentin Smith <[email protected]>2023-07-17 21:31:43 -0400
committerQuentin Smith <[email protected]>2023-07-17 21:31:43 -0400
commit6f02403184eb7fb7990fb88fc9df9c4328a690a3 (patch)
tree748f510e190bb2724750507a6e69ed1a8e08cb20 /.github
parentd896f80405aa8963877049ed999e4aba25d6e2bb (diff)
parent6b5df4523aa1c4902f02e803450ae4b418e0e3ca (diff)
Merge remote-tracking branch 'origin/main' into nrf-pdm
Diffstat (limited to '.github')
-rwxr-xr-x.github/ci/build-stable.sh16
-rwxr-xr-x.github/ci/build.sh19
-rwxr-xr-x.github/ci/doc.sh45
-rwxr-xr-x.github/ci/test.sh30
-rw-r--r--.github/workflows/rust.yml72
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
5set -euo pipefail
6
7export RUSTUP_HOME=/ci/cache/rustup
8export CARGO_HOME=/ci/cache/cargo
9export CARGO_TARGET_DIR=/ci/cache/target
10
11hashtime restore /ci/cache/filetime.json || true
12hashtime save /ci/cache/filetime.json
13
14sed -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
5set -euo pipefail
6
7export RUSTUP_HOME=/ci/cache/rustup
8export CARGO_HOME=/ci/cache/cargo
9export CARGO_TARGET_DIR=/ci/cache/target
10if [ -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)
14fi
15
16hashtime restore /ci/cache/filetime.json || true
17hashtime 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
4set -euo pipefail
5
6export RUSTUP_HOME=/ci/cache/rustup
7export CARGO_HOME=/ci/cache/cargo
8export CARGO_TARGET_DIR=/ci/cache/target
9export BUILDER_THREADS=4
10export 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
16rustc --version > /dev/null
17
18docserver-builder -i ./embassy-stm32 -o webroot/crates/embassy-stm32/git.zup
19docserver-builder -i ./embassy-boot/boot -o webroot/crates/embassy-boot/git.zup
20docserver-builder -i ./embassy-boot/nrf -o webroot/crates/embassy-boot-nrf/git.zup
21docserver-builder -i ./embassy-boot/rp -o webroot/crates/embassy-boot-rp/git.zup
22docserver-builder -i ./embassy-boot/stm32 -o webroot/crates/embassy-boot-stm32/git.zup
23docserver-builder -i ./embassy-embedded-hal -o webroot/crates/embassy-embedded-hal/git.zup
24docserver-builder -i ./embassy-executor -o webroot/crates/embassy-executor/git.zup
25docserver-builder -i ./embassy-futures -o webroot/crates/embassy-futures/git.zup
26docserver-builder -i ./embassy-lora -o webroot/crates/embassy-lora/git.zup
27docserver-builder -i ./embassy-net -o webroot/crates/embassy-net/git.zup
28docserver-builder -i ./embassy-net-driver -o webroot/crates/embassy-net-driver/git.zup
29docserver-builder -i ./embassy-net-driver-channel -o webroot/crates/embassy-net-driver-channel/git.zup
30docserver-builder -i ./embassy-nrf -o webroot/crates/embassy-nrf/git.zup
31docserver-builder -i ./embassy-rp -o webroot/crates/embassy-rp/git.zup
32docserver-builder -i ./embassy-sync -o webroot/crates/embassy-sync/git.zup
33docserver-builder -i ./embassy-time -o webroot/crates/embassy-time/git.zup
34docserver-builder -i ./embassy-usb -o webroot/crates/embassy-usb/git.zup
35docserver-builder -i ./embassy-usb-driver -o webroot/crates/embassy-usb-driver/git.zup
36docserver-builder -i ./embassy-usb-logger -o webroot/crates/embassy-usb-logger/git.zup
37docserver-builder -i ./cyw43 -o webroot/crates/cyw43/git.zup
38docserver-builder -i ./cyw43-pio -o webroot/crates/cyw43-pio/git.zup
39docserver-builder -i ./embassy-net-w5500 -o webroot/crates/embassy-net-w5500/git.zup
40docserver-builder -i ./embassy-stm32-wpan -o webroot/crates/embassy-stm32-wpan/git.zup --output-static webroot/static
41
42export KUBECONFIG=/ci/secrets/kubeconfig.yml
43POD=$(kubectl -n embassy get po -l app=docserver -o jsonpath={.items[0].metadata.name})
44kubectl cp webroot/crates $POD:/data
45kubectl 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
5set -euo pipefail
6
7export RUSTUP_HOME=/ci/cache/rustup
8export CARGO_HOME=/ci/cache/cargo
9export CARGO_TARGET_DIR=/ci/cache/target
10
11hashtime restore /ci/cache/filetime.json || true
12hashtime save /ci/cache/filetime.json
13
14cargo test --manifest-path ./embassy-sync/Cargo.toml
15cargo test --manifest-path ./embassy-embedded-hal/Cargo.toml
16cargo test --manifest-path ./embassy-hal-common/Cargo.toml
17cargo test --manifest-path ./embassy-time/Cargo.toml --features generic-queue
18
19cargo test --manifest-path ./embassy-boot/boot/Cargo.toml
20cargo test --manifest-path ./embassy-boot/boot/Cargo.toml --features nightly
21cargo test --manifest-path ./embassy-boot/boot/Cargo.toml --features nightly,ed25519-dalek
22cargo test --manifest-path ./embassy-boot/boot/Cargo.toml --features nightly,ed25519-salty
23
24cargo test --manifest-path ./embassy-nrf/Cargo.toml --no-default-features --features nightly,nrf52840,time-driver-rtc1,gpiote
25
26cargo test --manifest-path ./embassy-rp/Cargo.toml --no-default-features --features nightly,time-driver
27
28cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features nightly,stm32f429vg,exti,time-driver-any,exti
29cargo test --manifest-path ./embassy-stm32/Cargo.toml --no-default-features --features nightly,stm32f732ze,exti,time-driver-any,exti
30cargo 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 @@
1name: Rust
2
3on:
4 push:
5 branches: [staging, trying, master]
6 pull_request:
7 branches: [master]
8
9env:
10 CARGO_TERM_COLOR: always
11
12jobs:
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