Fix Radarr rename, GenStage issues, and update dependencies #169
This file contains hidden or 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 CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build and test | |
| runs-on: ubuntu-latest | |
| env: | |
| MIX_ENV: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: '1.19.2' | |
| otp-version: '28.0' | |
| version-type: 'strict' | |
| id: beam | |
| - name: Restore PLT cache | |
| uses: actions/cache@v4 | |
| id: plt-cache | |
| with: | |
| path: priv/plts | |
| key: ${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-plt-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-plt- | |
| - name: Install system dependencies and FFmpeg | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| mediainfo \ | |
| ffmpeg \ | |
| build-essential | |
| - name: Cache Rust toolchain | |
| uses: actions/cache@v4 | |
| id: rust-toolchain-cache | |
| with: | |
| path: | | |
| ~/.rustup | |
| ~/.cargo/registry/index | |
| ~/.cargo/registry/cache | |
| ~/.cargo/git/db | |
| key: ${{ runner.os }}-rust-toolchain-v3 | |
| restore-keys: | | |
| ${{ runner.os }}-rust-toolchain- | |
| - name: Cache ab-av1 binary | |
| uses: actions/cache@v4 | |
| id: ab-av1-cache | |
| with: | |
| path: ~/.cargo/bin/ab-av1 | |
| key: ${{ runner.os }}-ab-av1-binary-v3 | |
| restore-keys: | | |
| ${{ runner.os }}-ab-av1-binary- | |
| - name: Install Rust toolchain | |
| if: steps.rust-toolchain-cache.outputs.cache-hit != 'true' | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable | |
| - name: Install ab-av1 | |
| if: steps.ab-av1-cache.outputs.cache-hit != 'true' | |
| run: | | |
| source ~/.cargo/env | |
| cargo install ab-av1 --locked | |
| - name: Setup cargo PATH | |
| run: | | |
| # Ensure cargo is available in PATH for subsequent steps | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| source ~/.cargo/env || true | |
| - name: Cache Mix dependencies and build | |
| uses: actions/cache@v4 | |
| id: mix-cache | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-mix-${{ hashFiles('**/mix.lock') }}-${{ hashFiles('lib/**/*.ex', 'config/**/*.exs') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-mix-${{ hashFiles('**/mix.lock') }}- | |
| ${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-mix- | |
| - 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 | |
| if: steps.mix-cache.outputs.cache-hit != 'true' | |
| run: mix deps.get | |
| - name: Compile dependencies | |
| if: steps.mix-cache.outputs.cache-hit != 'true' | |
| 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 |