ops: Add automatic test runs and building for linux x86_64

This commit is contained in:
demenik
2025-11-29 18:57:31 +01:00
parent c69649f1ae
commit 4a4c60a9ed

32
.gitlab-ci.yml Normal file
View File

@@ -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