[poc] Elixir SDK #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Elixir SDK | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'elixir-sdk/**' | |
- 'eppo_core/**' | |
pull_request: | |
paths: | |
- 'elixir-sdk/**' | |
- 'eppo_core/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
elixir_test: | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# Elixir 1.18 with OTP 26 and 27 | |
- os: ubuntu | |
elixir: '1.18' | |
otp: '26.0' | |
- os: ubuntu | |
elixir: '1.18' | |
otp: '27.0' | |
# Elixir 1.17 with OTP 26 and 27 | |
- os: ubuntu | |
elixir: '1.17' | |
otp: '26.0' | |
- os: ubuntu | |
elixir: '1.17' | |
otp: '27.0' | |
# Elixir 1.16 with OTP 26 only | |
- os: ubuntu | |
elixir: '1.16' | |
otp: '26.0' | |
# Elixir 1.15 with OTP 26 only | |
- os: ubuntu | |
elixir: '1.15' | |
otp: '26.0' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up Elixir & Rust | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache Rust dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Cache Mix dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
deps | |
_build | |
key: ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
${{ runner.os }}-mix- | |
- run: npm ci | |
- name: Override eppo_core for testing | |
run: | | |
mkdir -p ~/.cargo/ | |
echo "[patch.crates-io.eppo_core]" >> "${CARGO_HOME:-$HOME/.cargo}/config.toml" | |
echo "path = '$PWD/eppo_core'" >> "${CARGO_HOME:-$HOME/.cargo}/config.toml" | |
- name: Install dependencies | |
run: mix deps.get | |
working-directory: elixir-sdk | |
- name: Compile | |
run: mix compile | |
working-directory: elixir-sdk | |
- name: Run tests | |
run: npm run with-server test:elixir |