Skip to content

Commit b21cc1f

Browse files
committed
restructure repository as a cargo workspace
This restructures the repository as a cargo workspace with two crates: - galileo-osnma, which contains the library and all the binaries that run on a host PC, including helpers that were previously in their own crate. - osnman-longan-nano, which contains the longan nano firmware. Additionally, just has been added as a command runner and the Github CI has been refactored.
1 parent 5a324e8 commit b21cc1f

46 files changed

Lines changed: 1131 additions & 2583 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@ rustflags = [
44
"-C", "link-arg=-Tmemory-cb.x",
55
"-C", "link-arg=-Tlink.x",
66
]
7-
8-
[build]
9-
target = "riscv32imac-unknown-none-elf"

.github/workflows/ci.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
RUST_LOG_STYLE: always
11+
RUSTDOCFLAGS: "-D warnings"
12+
JUST_COLOR: always
13+
14+
jobs:
15+
rust:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
galmon: ["galmon", ""]
21+
galmon-osnma: ["galmon-osnma", ""]
22+
osnma-longan-nano: ["osnma-longan-nano", ""]
23+
p521: ["p521", ""]
24+
std: ["std", ""]
25+
toolchain: ["stable", "1.88.0"]
26+
steps:
27+
- uses: actions/checkout@v6
28+
- name: Install toolchain
29+
run: |
30+
rustup install ${{ matrix.toolchain }}
31+
rustup component add --toolchain ${{ matrix.toolchain }} rustfmt
32+
rustup component add --toolchain ${{ matrix.toolchain }} clippy
33+
rustup component add --toolchain ${{ matrix.toolchain }} llvm-tools
34+
rustup target add --toolchain ${{ matrix.toolchain }} riscv32imac-unknown-none-elf
35+
- uses: cargo-bins/cargo-binstall@main
36+
- name: Install cargo-binutils
37+
run: cargo binstall cargo-binutils
38+
- uses: extractions/setup-just@v3
39+
- name: Install protoc
40+
if: ${{ matrix.galmon != '' || matrix.galmon-osnma != '' || matrix.osnma-longan-nano != '' }}
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install protobuf-compiler
44+
- name: Install libudev-dev
45+
if: ${{ matrix.osnma-longan-nano != '' }}
46+
run: |
47+
sudo apt-get update
48+
sudo apt-get install libudev-dev
49+
- name: Set environment
50+
run: |
51+
echo "RUSTUP_TOOLCHAIN=${{ matrix.toolchain }}" >> "$GITHUB_ENV"
52+
echo "CARGO_FEATURES=${{matrix.galmon}},${{matrix.galmon-osnma}},${{matrix.osnma-longan-nano}},${{matrix.p521}},${{matrix.std}}" >> "$GITHUB_ENV"
53+
- name: Format
54+
run: cargo fmt --all -- --check
55+
- name: Clippy
56+
run: cargo clippy --all-targets --no-default-features --features $CARGO_FEATURES -- -D warnings
57+
- name: Doc
58+
run: cargo doc --no-default-features --features $CARGO_FEATURES
59+
- name: Build
60+
run: cargo build --verbose --no-default-features --features $CARGO_FEATURES
61+
- name: Run tests
62+
run: cargo test --verbose --no-default-features --features $CARGO_FEATURES
63+
- name: Run clippy for osnma-longan-nano firmware
64+
run: just clippy-osnma-longan-nano
65+
- name: Build osnma-longan-nano firmware
66+
run: just osnma-longan-nano
67+
test-vectors:
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v6
71+
- name: Install protoc and libudev-dev
72+
run: |
73+
sudo apt-get update
74+
sudo apt-get install protobuf-compiler libudev-dev
75+
- name: Install ecdsa with pip
76+
run: pip install ecdsa
77+
- uses: extractions/setup-just@v3
78+
- name: Run test vectors
79+
run: just test-vectors
80+
pycodestyle:
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/checkout@v6
84+
- name: Install pycodestyle with pip
85+
run: pip install pycodestyle
86+
- name: Run pycodestyle
87+
run: pycodestyle .

.github/workflows/pycodestyle.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/rust.yml

Lines changed: 0 additions & 144 deletions
This file was deleted.

.github/workflows/test-vectors.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
/target
2-
/galmon-osnma/target
3-
/Cargo.lock
42
*~
5-
/osnma-longan-nano/target
6-
/osnma-longan-nano-client/target
3+
/osnma-longan-nano-firmware.bin

0 commit comments

Comments
 (0)