Files
songparser/.gitlab-ci.yml
2025-03-09 21:08:42 +00:00

40 lines
847 B
YAML

stages:
- build
- test
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- mv "$SSH_DEPLOY_KEY" gitlab_deploy_key # copies the file from the variable.
- chmod 600 gitlab_deploy_key
- ssh-add gitlab_deploy_key
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host gitlab.com\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- echo "$KNOWN_HOSTS" >> ~/.ssh/known_hosts
build:
stage: build
image: rust:1.85
script:
- cargo build --release
artifacts:
paths:
- target/release/songparser
expire_in: 1 week
cache:
key: "cargo-cache"
paths:
- target/
- ~/.cargo/
test:
stage: test
image: rust:latest
script:
- cargo test
cache:
key: "cargo-cache"
paths:
- target/
- ~/.cargo/