Skip to content

Fix Broadway pipelines stopping after each item #164

Fix Broadway pipelines stopping after each item

Fix Broadway pipelines stopping after each item #164

Workflow file for this run

name: Elixir CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
container:
image: alpine:3.21
env:
MIX_ENV: test
steps:
- name: Install system dependencies and FFmpeg
run: |
# Add community repository for 3.21 packages
echo "https://dl-cdn.alpinelinux.org/alpine/v3.21/community" >> /etc/apk/repositories
apk update
# Install basic system dependencies including GNU tar for GitHub Actions caching
apk add --no-cache \
git \
bash \
curl \
build-base \
openssl-dev \
ncurses-dev \
zlib-dev \
mediainfo \
cmake \
make \
gzip \
tar
# Verify tar installation for GitHub Actions caching compatibility
# GitHub Actions cache requires POSIX-compliant tar
which tar && tar --version | head -1
# Install FFmpeg with essential codec libraries (minimal set to avoid conflicts)
apk add --no-cache \
ffmpeg \
x264-libs \
x265-libs \
svt-av1
- name: Install Erlang and Elixir
run: |
# Install Erlang 27 and Elixir 1.19 from Alpine 3.21 (should be available in community repo)
apk add --no-cache \
erlang \
elixir
- uses: actions/checkout@v4
- name: Cache rustup and cargo installation
uses: actions/cache@v4
with:
path: |
~/.rustup
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git
key: ${{ runner.os }}-alpine-rust-${{ hashFiles('**/Cargo.lock') }}-v1
restore-keys: |
${{ runner.os }}-alpine-rust-
- name: Cache ab-av1 binary
uses: actions/cache@v4
id: ab-av1-cache
with:
path: ~/.cargo/bin/ab-av1
key: ${{ runner.os }}-alpine-ab-av1-${{ hashFiles('~/.cargo/bin/ab-av1') }}-v1
restore-keys: |
${{ runner.os }}-alpine-ab-av1-
- name: Install ab-av1
if: steps.ab-av1-cache.outputs.cache-hit != 'true'
run: |
# Install rustup to get latest stable Rust (Alpine's is too old)
if [ ! -f ~/.cargo/env ]; then
apk add --no-cache curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
fi
source ~/.cargo/env
# Add cargo to PATH for this and future steps
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
# Install latest stable ab-av1 with newer Rust toolchain
cargo install ab-av1
- name: Setup cargo PATH
run: |
# Ensure cargo is available in PATH for subsequent steps
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Cache Mix dependencies
uses: actions/cache@v4
with:
path: |
deps
_build/test/lib
key: ${{ runner.os }}-alpine-mix-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-alpine-mix-
- name: Cache compiled dependencies
uses: actions/cache@v4
with:
path: _build
key: ${{ runner.os }}-alpine-build-${{ hashFiles('mix.lock') }}-${{ hashFiles('lib/**/*.ex', 'test/**/*.exs', 'config/**/*.exs') }}
restore-keys: |
${{ runner.os }}-alpine-build-${{ hashFiles('mix.lock') }}-
${{ runner.os }}-alpine-build-
- name: Cache native dependencies
uses: actions/cache@v4
with:
path: |
deps/*/priv
deps/*/_build
key: ${{ runner.os }}-alpine-native-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-alpine-native-
- name: Verify environment
run: |
echo 'Elixir version:' && elixir --version
echo 'Erlang version:' && erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
echo 'ab-av1 version:' && ab-av1 --version
echo 'mediainfo version:' && mediainfo --version | head -1
echo 'ffmpeg version:' && ffmpeg -version | head -1
- name: Install dependencies
run: mix deps.get
- name: Compile dependencies
run: mix deps.compile
- name: Compile project
run: mix compile --warnings-as-errors
- name: Check formatting
run: mix format --check-formatted
- name: Run Credo
run: mix credo --strict
- name: Run tests
run: mix test