diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..6c97f353d33932730e2b39d47b12601101f821c7 --- /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/