From 4a4c60a9edc560b1db06e563d5e87185cdd9305e Mon Sep 17 00:00:00 2001 From: demenik Date: Sat, 29 Nov 2025 18:57:31 +0100 Subject: [PATCH] ops: Add automatic test runs and building for linux x86_64 --- .gitlab-ci.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..7b414d0 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,32 @@ +image: "rust:latest" +stages: + - build + - test +cache: + key: "$CI_COMMIT_REF_SLUG" + paths: + - .cargo/ + - target/ +.only_on_main_rule: &only_on_main_rule + rules: + - if: $CI_COMMIT_REF_SLUG == "main" +.install_linux_dependencies: &install_linux_dependencies + before_script: + - apt-get update -yq + - apt-get install -yq g++ pkg-config libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0 +linux_build: + stage: build + !!merge <<: *only_on_main_rule + !!merge <<: *install_linux_dependencies + script: + - cargo build --release --target x86_64-unknown-linux-gnu + artifacts: + paths: + - target/x86_64-unknown-linux-gnu/release/pomomon-garden + name: "pomomon-garden-linux-x86_64-$CI_COMMIT_SHORT_SHA" + expire_in: "2 weeks" +run_tests: + stage: test + !!merge <<: *install_linux_dependencies + script: + - cargo test --verbose