Skip to content

Commit

Permalink
Touch (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp authored Sep 30, 2020
1 parent 66d8b16 commit 5c4f86a
Show file tree
Hide file tree
Showing 24 changed files with 199 additions and 128 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/audit-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Security audit
on:
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/audit-check@v1
# FIXME: needs to cd into ./marauder https://github.com/actions-rs/audit-check/issues/116
with:
token: ${{ secrets.GITHUB_TOKEN }}
83 changes: 83 additions & 0 deletions .github/workflows/ci-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
on: [push, pull_request]

name: Continuous integration

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: armv7-unknown-linux-gnueabihf
override: true
components: rustfmt
- run: make ujipenchars2.txt
working-directory: marauder
- uses: marcopolo/cargo@master # TODO: - uses: actions-rs/cargo@v1 https://github.com/actions-rs/cargo/pull/59
with:
working-directory: marauder
use-cross: true
args: --target armv7-unknown-linux-gnueabihf
command: check

test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: armv7-unknown-linux-gnueabihf
override: true
components: rustfmt
- run: make ujipenchars2.txt
working-directory: marauder
- uses: marcopolo/cargo@master # TODO: - uses: actions-rs/cargo@v1 https://github.com/actions-rs/cargo/pull/59
with:
working-directory: marauder
use-cross: true
args: --target armv7-unknown-linux-gnueabihf
command: test

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: armv7-unknown-linux-gnueabihf
override: true
components: rustfmt
- uses: marcopolo/cargo@master # TODO: - uses: actions-rs/cargo@v1 https://github.com/actions-rs/cargo/pull/59
with:
working-directory: marauder
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: armv7-unknown-linux-gnueabihf
override: true
components: rustfmt, clippy
- uses: marcopolo/cargo@master # TODO: - uses: actions-rs/cargo@v1 https://github.com/actions-rs/cargo/pull/59
with:
working-directory: marauder
use-cross: true
args: --target armv7-unknown-linux-gnueabihf -- -D warnings
command: clippy
23 changes: 0 additions & 23 deletions .github/workflows/whiteboard.yml

This file was deleted.

51 changes: 43 additions & 8 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
on: [push]
name: Build for reMarkable
jobs:

build_for_remarkable:
name: with musl
runs-on: ubuntu-latest
Expand All @@ -11,15 +12,49 @@ jobs:
toolchain: nightly # TODO: stable once const-fn is in
target: armv7-unknown-linux-musleabihf
override: true
- run: rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu
- run: make ujipenchars2.txt
working-directory: marauder
- run: make test
working-directory: marauder
components: rustfmt
# TODO: following fails with error occurred: Failed to find tool. Is `arm-linux-gnueabihf-gcc` installed?
# - uses: marcopolo/cargo@master # TODO: - uses: actions-rs/cargo@v1 https://github.com/actions-rs/cargo/pull/59
# with:
# use-cross: true
# command: build
# working-directory: marauder
# args: --release --frozen --locked --offline --target armv7-unknown-linux-musleabihf
# continue-on-error: true

whiteboard_hypercard:
name: Whiteboard HyperCard
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: armv7-unknown-linux-gnueabihf
override: true
components: rustfmt
- uses: marcopolo/cargo@master # TODO: - uses: actions-rs/cargo@v1 https://github.com/actions-rs/cargo/pull/59
with:
working-directory: marauder
use-cross: true
command: build
working-directory: marauder
args: --release --frozen --locked --offline --target armv7-unknown-linux-musleabihf
continue-on-error: true
args: --target armv7-unknown-linux-gnueabihf --release --bin whiteboard --locked #--frozen #--offline
- if: startsWith(github.ref, 'refs/tags/')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
draft: false
prerelease: false
- if: startsWith(github.ref, 'refs/tags/')
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./marauder/target/armv7-unknown-linux-gnueabihf/release/whiteboard
asset_name: whiteboard
asset_content_type: application/octet-stream
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,8 @@ Visible rectangular elements that can be drawn/moved/zoomed/rotated/connected/du
* https://en.wikipedia.org/wiki/TRIZ
* https://eugeneyan.com/2020/04/05/note-taking-zettelkasten/
* https://github.com/alexandre01/deepsvg

## Donation

Feel free to donate to me through paypal.me/pierrefenoll1
Make sure to describe what I should be working on :)
File renamed without changes.
4 changes: 2 additions & 2 deletions marauder/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 6 additions & 28 deletions marauder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
# rustup target add armv7-unknown-linux-musleabihf --toolchain=nightly
# cargo install cross

TARGET = armv7-unknown-linux-musleabihf
# TARGET ?= armv7-unknown-linux-musleabihf
TARGET ?= armv7-unknown-linux-gnueabihf
EXE = marauder
BIN = ./target/$(TARGET)/release/$(EXE)
IMG ?= rust-build-remarkable:latest
DEVICE ?= remarkable
RUN ?= docker run --rm --user $$(id -u):$$(id -g)
FLATC ?= $(RUN) -v "$$PWD"/src:/src -v "$$PWD"/src:/dst neomantra/flatbuffers:clang-v1.12.0-cc0.6.0 flatc

all: src/strokes/strokes_generated.rs lint
cross build --release --target=$(TARGET)
cross build --target=$(TARGET) --release
ls -lh $(BIN)

fmt:
cargo fmt

lint: fmt
cross clippy --target=$(TARGET)
cross clippy --target=$(TARGET) #-- -W clippy::pedantic

test: fmt test-ujipenchars2
cargo test
Expand All @@ -33,7 +33,6 @@ test-ujipenchars2: ujipenchars2.txt
update:
cargo update

debug: DEVICE ?= [email protected]
debug: all
ssh $(DEVICE) 'killall -q -9 $(EXE) || true; systemctl stop xochitl || true'
scp -pC $(BIN) $(DEVICE):
Expand All @@ -42,31 +41,10 @@ debug: all
src/strokes/strokes_generated.rs: src/strokes/strokes.fbs
$(FLATC) --rust -o /dst/strokes /$^

.PHONY: docker-env
docker-env:
cd docker-toolchain && docker build \
--build-arg UNAME=builder \
--build-arg UID=$(shell id -u) \
--build-arg GID=$(shell id -g) \
--build-arg ostype=${shell uname} \
--tag $(IMG) .

whiteboard: DEVICE ?= [email protected]
whiteboard: HOST ?= http://fknwkdacd.com:10000
whiteboard: EXE = whiteboard
whiteboard: BIN = ./target/armv7-unknown-linux-gnueabihf/release/$(EXE)
whiteboard: VOLUME ?= cargoregistry
whiteboard: fmt docker-env
docker volume inspect $(VOLUME) >/dev/null 2>&1 || docker volume create $(VOLUME)
# TODO: https://github.com/toltec-dev/toolchain/issues/2
docker run \
-it --rm \
--user builder \
-v "$$PWD":/home/builder/libremarkable:rw \
-v $(VOLUME):/home/builder/.cargo/registry \
-w /home/builder/libremarkable \
$(IMG) \
cargo build --release --bin $(EXE) --target=armv7-unknown-linux-gnueabihf #--locked #--frozen #--offline
whiteboard: fmt
cross build --target=$(TARGET) --release --bin $(EXE) #--locked #--frozen #--offline
ssh $(DEVICE) 'killall -q -9 $(EXE) || true; systemctl stop xochitl || true'
scp -pC $(BIN) $(DEVICE):
ssh $(DEVICE) 'RUST_BACKTRACE=1 RUST_LOG=debug ./$(EXE) --host=$(HOST) | tail -f'
26 changes: 0 additions & 26 deletions marauder/docker-toolchain/Dockerfile

This file was deleted.

Loading

0 comments on commit 5c4f86a

Please sign in to comment.