Skip to content

feat: add LLMAnalytics.pop_span/1 function #372

feat: add LLMAnalytics.pop_span/1 function

feat: add LLMAnalytics.pop_span/1 function #372

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
env:
ELIXIR_VERSION: "1.18.3"
OTP_VERSION: "27.3"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
name: Build and test
runs-on: ubuntu-latest
# This is a complicated set of strategies, but Elixir has a complicated set of supported versions.
# See https://hexdocs.pm/elixir/compatibility-and-deprecations.html
# See https://hexdocs.pm/elixir/compatibility-and-deprecations.html#between-elixir-and-erlang-otp
strategy:
matrix:
elixir: ["1.17.x", "1.18.x", "1.19.x", "1.20.x"]
otp: ["25.x", "26.x", "27.x", "28.x", "29.x"]
exclude:
# Elixir 1.17 doesn't support OTP 28+
- elixir: "1.17.x"
otp: "28.x"
- elixir: "1.17.x"
otp: "29.x"
# Elixir 1.18 doesn't support OTP 28+
- elixir: "1.18.x"
otp: "28.x"
- elixir: "1.18.x"
otp: "29.x"
# Elixir 1.19 doesn't support OTP 25 and OTP 29
- elixir: "1.19.x"
otp: "25.x"
- elixir: "1.19.x"
otp: "29.x"
# Elixir 1.20 doesn't support OTP <= 25
- elixir: "1.20.x"
otp: "25.x"
- elixir: "1.20.x"
otp: "26.x"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Elixir
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.24.0
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Restore dependencies cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-${{ matrix.elixir }}-${{ matrix.otp }}
# Fallback to same elixir version, then same lockfile, then any cache
restore-keys: |
${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-${{ matrix.elixir }}-
${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-
${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Run tests
run: mix test
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Elixir
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.24.0
with:
elixir-version: ${{ env.ELIXIR_VERSION }}
otp-version: ${{ env.OTP_VERSION }}
- name: Restore dependencies cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}
# Fallback to same elixir version, then same lockfile, then any cache
restore-keys: |
${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-${{ env.ELIXIR_VERSION }}-
${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-
${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Check formatting
run: mix format --check-formatted
credo:
name: Credo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Elixir
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.24.0
with:
elixir-version: ${{ env.ELIXIR_VERSION }}
otp-version: ${{ env.OTP_VERSION }}
- name: Restore dependencies cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}
# Fallback to same elixir version, then same lockfile, then any cache
restore-keys: |
${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-${{ env.ELIXIR_VERSION }}-
${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-
${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Run static checks
run: mix credo --strict
compile:
name: Compile with warnings as errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Elixir
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.24.0
with:
elixir-version: ${{ env.ELIXIR_VERSION }}
otp-version: ${{ env.OTP_VERSION }}
- name: Restore dependencies cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}
# Fallback to same elixir version, then same lockfile, then any cache
restore-keys: |
${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-${{ env.ELIXIR_VERSION }}-
${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-
${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Compile with warnings as errors
run: mix compile --warnings-as-errors
- name: Check public API snapshot
run: mix posthog.public_api --check
package:
name: Hex package build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Elixir
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.24.0
with:
elixir-version: ${{ env.ELIXIR_VERSION }}
otp-version: ${{ env.OTP_VERSION }}
- name: Build Hex package
run: mix hex.build