-
Notifications
You must be signed in to change notification settings - Fork 8
79 lines (71 loc) · 2.69 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build --lib
run: cargo build --verbose
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run tests
run: cargo test --verbose
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Fmt
run: cargo fmt --all -- --check
# TODO: change to cargo build --example
xtensa-esp32-rust-example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# TODO: to avoid setupping, ci should pass on prepared dockers on self-hosted runners
- name: Setup build environment
run: cargo install espup && espup install
- name: Build
run: cd ./examples/rust-examples/xtensa-esp32 && . $HOME/export-esp.sh && cargo build
- name: Fmt
run: cd ./examples/rust-examples/xtensa-esp32 && cargo fmt --all -- --check
xtensa-esp32-static-library:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# TODO: to avoid setupping, ci should pass on prepared dockers on self-hosted runners
- name: Setup build environment
run: cargo install espup && espup install
- name: Build
run: cd ./c-library/xtensa-esp32 && . $HOME/export-esp.sh && cargo build
- name: Fmt
run: cd ./c-library/xtensa-esp32 && cargo fmt --all -- --check
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: xtensa-esp32-static-library
path: c-library/xtensa-esp32/target/xtensa-esp32-none-elf/debug/libxtensa_esp32_static_lib.a
retention-days: 7
xtensa-esp32-c-example:
needs: xtensa-esp32-static-library
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# TODO: to avoid setupping, ci should pass on prepared dockers on self-hosted runners
- name: Setup build environment
run: sudo apt-get install -y git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 && mkdir -p ~/esp && cd ~/esp && git clone -b v5.2 --recursive https://github.com/espressif/esp-idf.git && cd ~/esp/esp-idf && ./install.sh esp32
- name: Download static library
uses: actions/download-artifact@v4
with:
name: xtensa-esp32-static-library
path: c-library/xtensa-esp32/target/xtensa-esp32-none-elf/debug
- name: Build
run: cd ./examples/c-examples/xtensa-esp32 && . $HOME/esp/esp-idf/export.sh && idf.py build