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