Skip to content

Rc/0.2.17

Rc/0.2.17 #106

Workflow file for this run

name: Tests
on:
push:
branches: [main,release]
pull_request:
branches: [main,release]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: fiber_scheduler_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 5
env:
RUST_BACKTRACE: full
DATABASE_URL: postgres://postgres:postgres@localhost:5432/fiber_scheduler_test
PGHOST: localhost
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: fiber_scheduler_test
REDIS_URL: redis://localhost:6379
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: clippy, rustfmt
- name: Install libclang and dependencies
run: |
sudo apt-get update
sudo apt-get install -y libclang-dev pkg-config redis-tools
- name: Wait for PostgreSQL and Redis to become healthy
run: |
until pg_isready -h localhost -p 5432 -U postgres; do
echo "Waiting for Postgres..."
sleep 2
done
until redis-cli -h localhost ping | grep PONG; do
echo "Waiting for Redis..."
sleep 2
done
- name: Build Gems
run: |
bundle install
- name: Cache Cargo builds
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
gems/scheduler/target
gems/server/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Compile scheduler gem
run: bundle exec rake scheduler:compile
- name: Compile server gem
run: bundle exec rake server:compile
- name: Run Tests
run: |
bundle exec rake test