Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build_and_test_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ on:
- 'website/**'
- '**/*.md'
- 'bindings/python/**'
- 'bindings/elixir/**'
workflow_dispatch:

concurrency:
Expand Down
145 changes: 145 additions & 0 deletions .github/workflows/build_and_test_elixir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Elixir Build and Tests

on:
push:
branches:
- main
paths-ignore:
- 'website/**'
- '**/*.md'
pull_request:
branches:
- main
paths-ignore:
- 'website/**'
- '**/*.md'
- 'bindings/cpp/**'
- 'bindings/python/**'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
build-and-test:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
OTP_VERSION: "28.0.2"
ELIXIR_VERSION: "1.19.5"
FLUSS_TEST_CLUSTER_BIN: ${{ github.workspace }}/target/debug/fluss-test-cluster
MIX_ENV: test
steps:
- uses: actions/checkout@v6

# Workaround: erlef/setup-beam is not on the ASF action allowlist
# yet. Once it is, this block collapses to a single setup-beam step.
# In the meantime we build OTP from source and cache it — the previous
# apt-based approach died when Erlang Solutions shut down their repo
# in Jan 2025 (https://binaries2.erlang-solutions.com/packages.html).
#
# The job runs on the native runner (no `container:`) so that the
# testcontainers-rs calls inside fluss-test-cluster can reach the
# runner's own Docker daemon during integration tests.
- name: Install OTP build deps
run: |
sudo apt-get update
sudo apt-get install -y build-essential autoconf m4 libncurses-dev \
libssl-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop

- name: Cache OTP
id: otp-cache
uses: actions/cache@v4
with:
path: /opt/otp
key: ${{ runner.os }}-otp-${{ env.OTP_VERSION }}-v1

- name: Build OTP from source
if: steps.otp-cache.outputs.cache-hit != 'true'
run: |
curl -fsSL -o /tmp/otp.tar.gz \
"https://github.com/erlang/otp/releases/download/OTP-${OTP_VERSION}/otp_src_${OTP_VERSION}.tar.gz"
tar xf /tmp/otp.tar.gz -C /tmp
cd /tmp/otp_src_${OTP_VERSION}
./configure --prefix=/opt/otp --without-wx --without-debugger \
--without-observer --without-javac
make -j$(nproc)
sudo make install

- name: Put OTP on PATH
run: |
echo "/opt/otp/bin" >> "$GITHUB_PATH"
/opt/otp/bin/erl -eval 'io:format("OTP ~s~n", [erlang:system_info(otp_release)]), halt().' -noshell

- name: Install Elixir
run: |
curl -fsSL -o /tmp/elixir.zip \
"https://github.com/elixir-lang/elixir/releases/download/v${ELIXIR_VERSION}/elixir-otp-28.zip"
sudo mkdir -p /usr/local/elixir
sudo unzip -qo /tmp/elixir.zip -d /usr/local/elixir
echo "/usr/local/elixir/bin" >> "$GITHUB_PATH"
/usr/local/elixir/bin/elixir --version

- name: Install protoc
run: sudo apt-get install -y protobuf-compiler

- name: Rust Cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1

- name: Cache Mix deps and build
uses: actions/cache@v4
with:
path: |
bindings/elixir/deps
bindings/elixir/_build
key: ${{ runner.os }}-mix-otp${{ env.OTP_VERSION }}-elixir${{ env.ELIXIR_VERSION }}-${{ hashFiles('bindings/elixir/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-otp${{ env.OTP_VERSION }}-elixir${{ env.ELIXIR_VERSION }}-

- name: Build fluss-test-cluster binary
run: cargo build -p fluss-test-cluster

- name: Fetch Elixir deps
working-directory: bindings/elixir
run: mix deps.get

- name: Check formatting
working-directory: bindings/elixir
run: mix format --check-formatted

- name: Compile (warnings as errors)
working-directory: bindings/elixir
run: mix compile --warnings-as-errors

- name: Credo
working-directory: bindings/elixir
run: mix credo

- name: Run unit tests
working-directory: bindings/elixir
run: mix test

- name: Run integration tests
working-directory: bindings/elixir
run: mix test --include integration --only integration
env:
RUST_LOG: DEBUG
RUST_BACKTRACE: full
1 change: 1 addition & 0 deletions .github/workflows/build_and_test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ on:
- 'website/**'
- '**/*.md'
- 'bindings/cpp/**'
- 'bindings/elixir/**'
workflow_dispatch:

concurrency:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_and_test_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ on:
- '**/*.md'
- 'bindings/python/**'
- 'bindings/cpp/**'
- 'bindings/elixir/**'
workflow_dispatch:

concurrency:
Expand Down
Loading
Loading