From e3f341ef25539f25051673ad15dd01dfceac6187 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu <sam@rfc1149.net> Date: Thu, 11 Jul 2024 23:25:20 +0200 Subject: [PATCH] Add gitlab CI file --- .gitlab-ci.yml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..6c97f35 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,52 @@ +stages: + - check + - build + - test + - deploy + +rust-lint: + image: rust + stage: check + script: + - rustup default nightly + - rustup component add rustfmt clippy + - rustup target install thumbv7m-none-eabi + - cargo fmt --all --check + - cargo clippy --all + +python-lint: + image: alpine + stage: check + script: + - apk add py3-flake8 + - flake8 + +build-rust: + image: rust + stage: build + script: + - rustup default nightly + - rustup target install thumbv7m-none-eabi + - cargo build --release + artifacts: + paths: + - target/thumbv7m-none-eabi/release/dc-motor-driver-hat + +test-rust: + image: rust + stage: test + script: + - rustup default nightly + - cd pid + - cargo test --target x86_64-unknown-linux-gnu + +deploy: + image: alpine + stage: deploy + script: + - mkdir firmware + - cp target/thumbv7m-none-eabi/release/dc-motor-driver-hat firmware/ + - cp controller/python/controller.py firmware/ + artifacts: + paths: + - firmware/ -- GitLab