-
Notifications
You must be signed in to change notification settings - Fork 9
201 lines (184 loc) · 6.87 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: Martos ci workflow
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
# TODO: all should be on self-hosted runners
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --lib --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
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Clippy
run: cargo clippy -- -D clippy::all
xtensa-esp32-rust-example-hello-world:
runs-on: ubuntu-latest
env:
CARGO_HOME: /root/.cargo
RUSTUP_HOME: /root/.rustup
container:
image: arkhipovivan1/xtensa-esp32-rust:latest
options: --user root
steps:
- uses: actions/checkout@v3
- name: Build
run: cd ./examples/rust-examples/xtensa-esp32/hello-world && . /root/export-esp.sh && cargo build
- name: Fmt
run: cd ./examples/rust-examples/xtensa-esp32/hello-world && cargo fmt --all -- --check
xtensa-esp32-rust-example-dynamic-memory:
runs-on: ubuntu-latest
env:
CARGO_HOME: /root/.cargo
RUSTUP_HOME: /root/.rustup
container:
image: arkhipovivan1/xtensa-esp32-rust:latest
options: --user root
steps:
- uses: actions/checkout@v3
- name: Build
run: cd ./examples/rust-examples/xtensa-esp32/dynamic-memory && . /root/export-esp.sh && cargo build
- name: Fmt
run: cd ./examples/rust-examples/xtensa-esp32/dynamic-memory && cargo fmt --all -- --check
xtensa-esp32-rust-example-timer:
runs-on: ubuntu-latest
env:
CARGO_HOME: /root/.cargo
RUSTUP_HOME: /root/.rustup
container:
image: arkhipovivan1/xtensa-esp32-rust:latest
options: --user root
steps:
- uses: actions/checkout@v3
- name: Build
run: cd ./examples/rust-examples/xtensa-esp32/timer && . /root/export-esp.sh && cargo build
- name: Fmt
run: cd ./examples/rust-examples/xtensa-esp32/timer && cargo fmt --all -- --check
xtensa-esp32-static-library:
runs-on: ubuntu-latest
env:
CARGO_HOME: /root/.cargo
RUSTUP_HOME: /root/.rustup
container:
image: arkhipovivan1/xtensa-esp32-rust:latest
options: --user root
steps:
- uses: actions/checkout@v3
- name: Build
run: cd ./c-library/xtensa-esp32 && . /root/export-esp.sh && cargo build --release
- 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/release/libxtensa_esp32_static_lib.a
retention-days: 7
xtensa-esp32-c-example:
needs: xtensa-esp32-static-library
runs-on: ubuntu-latest
env:
IDF_PATH: /root/esp/esp-idf
IDF_TOOLS_PATH: /root/.espressif
container:
image: arkhipovivan1/xtensa-esp32-c:latest
options: --user root
steps:
- uses: actions/checkout@v3
- 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/release
- name: Build
run: cd ./examples/c-examples/xtensa-esp32 && . /root/esp/esp-idf/export.sh && make && esptool.py --chip esp32 elf2image --flash_mode="dio" --flash_freq "40m" --flash_size "4MB" -o main.bin main.elf
mips64-rust-example-hello-world:
runs-on: ubuntu-latest
env:
CARGO_HOME: /root/.cargo
RUSTUP_HOME: /root/.rustup
container:
image: ubuntu:latest
options: --user root
steps:
- uses: actions/checkout@v3
- name: Dependencies
run: apt update -y && apt install curl build-essential lld -y && curl https://sh.rustup.rs -sSf | sh -s -- -y && export PATH="/root/.cargo/bin:${PATH}" && source "/root/.cargo/env" && rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
- name: Build
run: cd ./examples/rust-examples/mips64/hello-world && cargo build --release
- name: Fmt
run: cd ./examples/rust-examples/mips64/hello-world && cargo fmt --all -- --check
mips64-rust-example-dynamic-memory:
runs-on: ubuntu-latest
env:
CARGO_HOME: /root/.cargo
RUSTUP_HOME: /root/.rustup
container:
image: ubuntu:latest
options: --user root
steps:
- uses: actions/checkout@v3
- name: Dependencies
run: apt update -y && apt install curl build-essential lld -y && curl https://sh.rustup.rs -sSf | sh -s -- -y && export PATH="/root/.cargo/bin:${PATH}" && source "/root/.cargo/env" && rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
- name: Build
run: cd ./examples/rust-examples/mips64/dynamic-memory && cargo build --release
- name: Fmt
run: cd ./examples/rust-examples/mips64/dynamic-memory && cargo fmt --all -- --check
mips64-rust-example-timer:
runs-on: ubuntu-latest
env:
CARGO_HOME: /root/.cargo
RUSTUP_HOME: /root/.rustup
container:
image: ubuntu:latest
options: --user root
steps:
- uses: actions/checkout@v3
- name: Dependencies
run: apt update -y && apt install curl build-essential lld -y && curl https://sh.rustup.rs -sSf | sh -s -- -y && export PATH="/root/.cargo/bin:${PATH}" && source "/root/.cargo/env" && rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
- name: Build
run: cd ./examples/rust-examples/mips64/timer && cargo build --release
- name: Fmt
run: cd ./examples/rust-examples/mips64/timer && cargo fmt --all -- --check
mips64-static-library:
runs-on: ubuntu-latest
env:
CARGO_HOME: /root/.cargo
RUSTUP_HOME: /root/.rustup
container:
image: ubuntu:latest
options: --user root
steps:
- uses: actions/checkout@v3
- name: Dependencies
run: apt update -y && apt install curl build-essential lld -y && curl https://sh.rustup.rs -sSf | sh -s -- -y && export PATH="/root/.cargo/bin:${PATH}" && source "/root/.cargo/env" && rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
- name: Build
run: cd ./c-library/mips64 && cargo build --release
- name: Fmt
run: cd ./c-library/mips64 && cargo fmt --all -- --check
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: mips64-static-library
path: c-library/mips64/target/mips64el-unknown-linux-gnuabi64/release/libmips64_static_lib.a
retention-days: 7