Skip to content

fix(ci): optimize GitHub Actions to prevent disk space issues #185

fix(ci): optimize GitHub Actions to prevent disk space issues

fix(ci): optimize GitHub Actions to prevent disk space issues #185

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 'stable'
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
# Cache key differentiation
key: "v1-rust"
# Clean cache if it gets too large
cache-directories: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
- name: Install PostgreSQL client
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
- name: Build and test
run: |
# Build in release mode to save space and be faster
cargo build --release
# Run tests (this will reuse the release build where possible)
cargo test --release
- name: Install bc (for test timing calculations)
run: sudo apt-get install -y bc
- name: Run integration tests - TCP with SSL
run: |
chmod +x tests/runner/run_ssl_tests.sh
./tests/runner/run_ssl_tests.sh --mode tcp-ssl
- name: Run integration tests - TCP without SSL
run: ./tests/runner/run_ssl_tests.sh --mode tcp-no-ssl
- name: Run integration tests - Unix socket
run: ./tests/runner/run_ssl_tests.sh --mode unix-socket
- name: Run integration tests - File DB with SSL
run: ./tests/runner/run_ssl_tests.sh --mode file-ssl
- name: Run integration tests - File DB without SSL
run: ./tests/runner/run_ssl_tests.sh --mode file-no-ssl