Skip to content

style: address credo refactoring opportunities #65

style: address credo refactoring opportunities

style: address credo refactoring opportunities #65

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Elixir CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
name: Build and test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/setup-beam@61e01a43a562a89bfc54c7f9a378ff67b03e4a21 # v1.16.0
with:
elixir-version: '1.18.3' # [Required] Define the Elixir version
otp-version: '27.3.4' # [Required] Define the Erlang/OTP version
- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Install additional tools
run: |
sudo apt-get update
sudo apt-get install -y fd-find ffmpeg zstd
# Install ab-av1 from GitHub releases
wget -O /tmp/ab-av1.tar.zst https://github.com/alexheretic/ab-av1/releases/download/v0.10.1/ab-av1-v0.10.1-x86_64-unknown-linux-musl.tar.zst
cd /tmp && zstd -d ab-av1.tar.zst && tar -xf ab-av1.tar
sudo mv ab-av1 /usr/local/bin/ab-av1
sudo chmod +x /usr/local/bin/ab-av1
- name: Set up PostgreSQL
uses: harmon758/postgresql-action@v1
with:
postgresql version: '15'
postgresql db: reencodarr_test
postgresql user: postgres
postgresql password: postgres
- name: Wait for PostgreSQL
run: |
for i in {1..30}; do
pg_isready -h localhost -p 5432 -U postgres && break
sleep 1
done
- name: Set MIX_ENV to test
run: echo "MIX_ENV=test" >> $GITHUB_ENV
- name: Run tests
run: mix test