Skip to content

Clustering - Write to tempfile first when getting full file #4512

Clustering - Write to tempfile first when getting full file

Clustering - Write to tempfile first when getting full file #4512

Workflow file for this run

name: CI
on:
pull_request:
paths:
- Makefile
- 'src/**'
- 'spec/**'
- 'shard.*'
- 'static/**'
- 'views/**'
- '.github/workflows/ci.yml'
- 'build/build_docs_in_ci'
- 'openapi/**'
push:
branches:
- main
paths:
- Makefile
- 'src/**'
- 'spec/**'
- 'playwright.config.js'
- 'shard.*'
- 'static/**'
- 'views/**'
- '.github/workflows/ci.yml'
- 'build/build_docs_in_ci'
- 'openapi/**'
jobs:
format:
name: Format check
runs-on: ubuntu-latest
continue-on-error: true
container: 84codes/crystal:latest-ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: crystal tool format --check
lint:
name: Lint check
runs-on: ubuntu-latest
continue-on-error: true
container: 84codes/crystal:latest-ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Checkout ameba
uses: actions/checkout@v4
with:
repository: crystal-ameba/ameba
path: ameba
- name: Build ameba
run: make -C ameba
- name: Run ameba
run: ameba/bin/ameba src spec
lint-js:
name: Lint javascript
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- name: Run standard
run: make lint-js
lint-openapi:
name: Lint OpenAPI
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- name: Run spectral
run: make lint-openapi
spec:
name: Spec
runs-on: ubuntu-latest
container: 84codes/crystal:latest-ubuntu-24.04
timeout-minutes: 10
steps:
- name: Print Crystal version
run: crystal -v
- name: Install dependencies
run: apt-get update && apt-get install -y liblz4-dev etcd-server
- name: Checkout
uses: actions/checkout@v4
- name: Spec
run: make test
spec_osx:
name: Spec OS X
runs-on: macos-14
timeout-minutes: 10
steps:
- name: Install dependencies
run: |
brew install crystal etcd
echo "/opt/homebrew/opt/etcd/bin" >> $GITHUB_PATH
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
- run: crystal --version
- uses: actions/checkout@v4
- name: Spec
run: make test
compile:
name: Compile LavinMQ
runs-on: ubuntu-latest
container: 84codes/crystal:latest-ubuntu-24.04
steps:
- name: Install dependencies
run: apt-get update && apt-get install -y liblz4-dev
- name: Checkout
uses: actions/checkout@v4
- name: Build lavinmq
run: make -j bin/lavinmq bin/lavinmqctl DOCS= CRYSTAL_FLAGS=-Dbake_static
- name: Print build info
run: bin/lavinmq --build-info
- name: Upload bin/
uses: actions/upload-artifact@v4
with:
name: bin
path: bin/
path_filter:
name: Filters for frontend specs
runs-on: ubuntu-latest
outputs:
views: ${{ steps.changes.outputs.views }}
js: ${{ steps.changes.outputs.js }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
views:
- '**/*.ecr'
js:
- '**/*.js'
spec_frontend:
name: Frontend specs
runs-on: ubuntu-24.04
needs: [compile, path_filter]
if: ${{ needs.path_filter.outputs.views == 'true' || needs.path_filter.outputs.js == 'true' }}
steps:
- name: Install LavinMQ dependencies
run: |
sudo apt-get update
sudo apt-get install -y make libevent-2.1-7 liblz4-1
- name: Download lavinmq
uses: actions/download-artifact@v4
with:
name: bin
path: bin
- name: Run LavinMQ in background
run: |
chmod +x bin/*
bin/lavinmq --data-dir=/tmp/amqp --bind=:: &
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install @playwright/test
run: npm install @playwright/test
- name: List npm packages
run: npm ls
- name: Install browsers
run: npx playwright install --with-deps
- name: Run tests
run: npx playwright test --reporter=list
java-client-test:
name: RabbitMQ java client test
runs-on: ubuntu-24.04
needs: compile
continue-on-error: true
steps:
- name: Install LavinMQ dependencies
run: |
sudo apt-get update
sudo apt-get install -y make libevent-2.1-7 openjdk-21-jre-headless liblz4-1
- uses: actions/download-artifact@v4
with:
name: bin
path: bin
- name: Run LavinMQ in background
run: |
chmod +x bin/*
bin/lavinmq --data-dir=/tmp/amqp --bind=:: &
- name: Clone java client
uses: actions/checkout@v4
with:
repository: rabbitmq/rabbitmq-java-client
ref: v5.22.0
path: rabbitmq-java-client
- name: Get patch file
uses: actions/checkout@v4
with:
repository: cloudamqp/lavinmq
path: lavinmq
# only checkout the lint rules
sparse-checkout: |
.github/rabbitmq-java-client.patch
sparse-checkout-cone-mode: false
- name: Patch tests
run: |
cd rabbitmq-java-client
git apply ../lavinmq/.github/rabbitmq-java-client.patch
- name: Run java tests (allowed to fail)
id: test
run: |
cd rabbitmq-java-client
make deps
./mvnw verify -Dtest-broker.A.nodename=lavin@testhost -Dit.test=ClientTestSuite,FunctionalTestSuite -Drabbitmqctl.bin=../bin/lavinmqctl
bunny-test:
name: Bunny client test
runs-on: ubuntu-24.04
needs: compile
steps:
- name: Install LavinMQ dependencies
run: |
sudo apt-get update
sudo apt-get install -y libevent-2.1-7 liblz4-1
- name: Checkout LavinMQ for bunny_definitions.json
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: bin
path: bin
- name: Run LavinMQ in background
run: |
chmod +x bin/lavinmq
bin/lavinmq --data-dir /tmp/amqp &
- name: Import definitions
run: |
chmod +x bin/lavinmqctl
bin/lavinmqctl import_definitions .github/bunny_definitions.json
- name: Clone Bunny
uses: actions/checkout@v4
with:
repository: ruby-amqp/bunny
path: bunny
fetch-depth: 0
ref: "2.17.0"
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
working-directory: bunny
ruby-version: 2.7.2
bundler-cache: true
- name: Run specs
run: |
cd bunny
bundle exec rspec \
--pattern "spec/*/integration/*_spec.rb, spec/issues/*_spec.rb" \
--exclude-pattern "**/*/tls_*, **/*/connection_recovery_*"
ruby-http-api-test:
name: RabbitMQ HTTP API Ruby client test
runs-on: ubuntu-24.04
needs: compile
continue-on-error: true
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libevent-2.1-7 liblz4-1
- uses: actions/download-artifact@v4
with:
name: bin
path: bin
- name: Run LavinMQ in background
run: |
chmod +x bin/lavinmq
bin/lavinmq --data-dir /tmp/amqp &
- name: Clone HTTP API client
uses: actions/checkout@v4
with:
repository: cloudamqp/rabbitmq_http_api_client
token: ${{ secrets.PRIVATE_REPO_ACCESS }}
path: rabbitmq_http_api_client
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
working-directory: rabbitmq_http_api_client
ruby-version: 2.7.1
bundler-cache: true
- name: Run specs
run: |
cd rabbitmq_http_api_client
bundle exec rspec
go-http-api-test:
name: RabbitMQ HTTP API Go client test
runs-on: ubuntu-24.04
needs: compile
continue-on-error: true
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libevent-2.1-7 liblz4-1
- uses: actions/download-artifact@v4
with:
name: bin
path: bin
- name: Run LavinMQ in background
run: |
chmod +x bin/*
bin/lavinmq --data-dir /tmp/amqp &
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.3
- name: Clone http client
uses: actions/checkout@v4
with:
repository: michaelklishin/rabbit-hole
ref: 37defcefa36b528b024f0b377435b459eb8eb9fc
path: rabbit-hole
- name: Setup rabbit-hole
run: |
cd rabbit-hole
curl https://raw.githubusercontent.com/cloudamqp/lavinmq/main/.github/rabbit-hole.patch -o rabbit-hole.patch
git apply rabbit-hole.patch
bash bin/ci/before_build.sh
env:
RABBITHOLE_LAVINMQCTL: ../bin/lavinmqctl
- name: Run specs
run: |
cd rabbit-hole
go test -v ./...
release-mode-test:
name: Test in release mode
runs-on: ubuntu-24.04
needs: compile
continue-on-error: true
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libevent-2.1-7 liblz4-1
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: bin
path: bin
- name: Run LavinMQ in background
run: |
chmod +x bin/lavinmq
bin/lavinmq --data-dir /tmp/amqp &
- name: Test the static HTTP controller
run: ./extras/static_requests.sh
freebsd-test:
name: Spec FreeBSD
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Spec
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: pkg install -y crystal shards security/openssl curl gmake coreos-etcd34
run: gmake test
continue-on-error: true