Skip to content

Migrate to Vite 8 with jsbundling-rails and rails-vite-plugin #365

Migrate to Vite 8 with jsbundling-rails and rails-vite-plugin

Migrate to Vite 8 with jsbundling-rails and rails-vite-plugin #365

Workflow file for this run

name: System Tests
on:
push:
branches:
- master
pull_request:
jobs:
rspec_system:
runs-on: ubuntu-latest
env:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
BUNDLE_FROZEN: true
CI: true
DATABASE_URL: postgres://postgres:postgres@localhost:5432
CHROME_URL: http://localhost:3000
ANYCABLE_RPC_HOST: 0.0.0.0:50051
RAILS_ENV: test
services:
postgres:
image: postgres:16.0
env:
POSTGRES_PASSWORD: postgres
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:6.2-alpine
ports: ["6379:6379"]
options: --health-cmd="redis-cli ping" --health-interval 1s --health-timeout 3s --health-retries 30
chrome:
image: browserless/chrome:latest
ports: ["3000:3000"]
options: -e CONNECTION_TIMEOUT=600000 -e PORT=3000
anycable:
image: anycable/anycable-go:1.5.0
ports: ["8080:8080"]
options: --add-host=host.docker.internal:host-gateway
env:
ANYCABLE_HOST: "0.0.0.0"
ANYCABLE_REDIS_URL: redis://host.docker.internal:6379/0
ANYCABLE_RPC_HOST: host.docker.internal:50051
steps:
- uses: actions/checkout@v3
- name: Install PostgreSQL client
run: |
sudo apt-get -yqq install libpq-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
bundler-cache: true
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-
- name: Yarn install
run: |
yarn install
- name: Run RSpec
run: |
bundle exec rails db:test:prepare
export ANYCABLE_WEBSOCKET_URL="ws://$(hostname):8080/cable"
bundle exec rspec --tag type:system --force-color
wsdirector:
runs-on: ubuntu-latest
env:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
BUNDLE_FROZEN: true
CI: true
DATABASE_URL: postgres://postgres:postgres@localhost:5432
ANYCABLE_RPC_HOST: 0.0.0.0:50051
RAILS_ENV: test
services:
postgres:
image: postgres:16.0
env:
POSTGRES_PASSWORD: postgres
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:6.2-alpine
ports: ["6379:6379"]
options: --health-cmd="redis-cli ping" --health-interval 1s --health-timeout 3s --health-retries 30
anycable:
image: anycable/anycable-go:1.5.0
ports: ["8080:8080"]
options: --add-host=host.docker.internal:host-gateway
env:
ANYCABLE_HOST: "0.0.0.0"
ANYCABLE_REDIS_URL: redis://host.docker.internal:6379/0
ANYCABLE_RPC_HOST: host.docker.internal:50051
ANYCABLE_DEBUG: "true"
steps:
- uses: actions/checkout@v3
- name: Install PostgreSQL client
run: |
sudo apt-get -yqq install libpq-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
bundler-cache: true
- name: Run WebSocket Director scenarios
run: |
bundle exec rails db:test:prepare
bundle exec rails db:seed
mkdir -p tmp/pids
bundle exec anycabled start
sleep 10
gem install wsdirector-cli
wsdirector etc/wsdirector/chat.yml localhost:8080/cable -c -vv