Files
icarus_dm/.github/workflows/rust-ubuntu-latest.yml
T
2025-03-12 19:47:39 -04:00

53 lines
1.4 KiB
YAML

name: Rust
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust version
run: rustup install 1.85.0 && rustup default 1.85.0
- name: Add SSH Keys
run: |
echo "Starting"
sudo apt update -y
# 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
eval $(ssh-agent -s)
echo $NO_VEIL
echo "Look before"
# mv "$SSH_DEPLOY_KEY" gitlab_deploy_key # copies the file from the variable.
if [[ -z "$PRV_KEY" ]]; then echo "PRV_KEY is empty!"; exit 1; else echo "PRV_KEY is set."; fi
echo ${{ secrets.SECRET_TEST }}
echo ${{ secrets.SSH_PRIVATE_KEY }} > gitlab_deploy_key
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'
env:
PRV_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SOME_SECR: ${{ secrets.SECRET_TEST }}
- name: Build
run: cargo build --verbose
- name: Echo Test Start Message
run: echo "Starting Rust tests..."
- name: Run tests
run: cargo test --verbose
- name: Echo End Message
run: echo "Rust build and test process completed."