Skip to content

refactor: deprecate legacy history backfill #578

refactor: deprecate legacy history backfill

refactor: deprecate legacy history backfill #578

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
jobs:
lint:
name: Lint
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
MIX_ENV: dev
steps:
- uses: actions/checkout@v4
- name: Check for CHANGELOG.md modifications
if: github.event_name == 'pull_request'
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
files="$(gh api --paginate repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files --jq '.[].filename')"
if echo "$files" | grep -qE '^CHANGELOG\.md$'; then
echo "::error::CHANGELOG.md should not be edited manually - it is auto-generated by git_ops during releases."
exit 1
fi
echo "No CHANGELOG.md modifications detected."
- uses: erlef/setup-beam@v1
with:
otp-version: "28"
elixir-version: "1.19"
- name: Restore Hex/Mix cache
uses: actions/cache@v4
with:
path: |
~/.hex
~/.mix
key: ${{ runner.os }}-beamtools-otp28-elixir1.19-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-beamtools-otp28-elixir1.19-
- name: Install Hex/Rebar
run: |
set -euo pipefail
mix local.hex --force
mix local.rebar --force
- name: Restore dependencies cache
id: deps-cache
uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ env.MIX_ENV }}-otp28-elixir1.19-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.MIX_ENV }}-otp28-elixir1.19-
- name: Remove cached rebar3 build artifacts in deps
if: steps.deps-cache.outputs.cache-hit != 'true'
run: |
if [ -d deps ]; then
find deps -maxdepth 6 -type d \( -name _build -o -name .rebar3 \) -prune -exec rm -rf {} + || true
find deps -maxdepth 6 -type f -name rebar3.crashdump -delete || true
fi
- name: Install dependencies
run: mix deps.get
- name: Compile dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: mix deps.compile
- name: Create PLT directory
run: mkdir -p priv/plts
- name: Restore Dialyzer PLT cache
uses: actions/cache@v4
with:
path: priv/plts
key: ${{ runner.os }}-plt-otp28-elixir1.19-${{ hashFiles('mix.lock', 'mix.exs') }}
restore-keys: |
${{ runner.os }}-plt-otp28-elixir1.19-
- name: Run lint checks
run: mix quality
- name: Check for unused dependencies
run: mix deps.unlock --check-unused
- name: Audit Hex dependencies
run: mix hex.audit
- name: Validate Hex package
if: github.event_name == 'pull_request'
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY || 'dry-run' }}
run: mix hex.publish --dry-run --yes
test:
name: Test / Elixir ${{ matrix.elixir }}
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
otp: ["27", "28"]
elixir: ["1.18", "1.19"]
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Cache only immutable package downloads; avoid cached archives/binaries.
- name: Restore Hex package cache
uses: actions/cache@v4
with:
path: |
~/.hex/packages
~/.hex/cache.ets
key: ${{ runner.os }}-hex-v2-otp${{ matrix.otp }}-elixir${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
- name: Restore dependencies cache
uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ env.MIX_ENV }}-otp${{ matrix.otp }}-elixir${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
# Always install fresh Hex/Rebar after cache restore to avoid poisoned archives.
- name: Install Hex/Rebar
run: |
set -euo pipefail
mix local.hex --force
mix local.rebar --force
mix hex.info >/dev/null
- name: Remove cached rebar3 build artifacts in deps
run: |
if [ -d deps ]; then
find deps -maxdepth 6 -type d \( -name _build -o -name .rebar3 \) -prune -exec rm -rf {} + || true
find deps -maxdepth 6 -type f -name rebar3.crashdump -delete || true
fi
- name: Install dependencies
run: mix deps.get
- name: Compile dependencies
run: mix deps.compile
- name: Compile project
run: mix compile --warnings-as-errors
- name: Run tests
run: mix test
build-check:
name: Build Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: erlef/setup-beam@v1
with:
otp-version: "27"
elixir-version: "1.18"
- run: mix deps.get
- run: mix llm_db.build --check --install
- name: Check history drift
run: mix llm_db.history.check --allow-missing --allow-outdated