Skip to content

Fix Credo warnings, simplify code with Credo #44

Fix Credo warnings, simplify code with Credo

Fix Credo warnings, simplify code with Credo #44

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: self-hosted
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Read .tool-versions
uses: marocchino/tool-versions-action@v1
id: versions
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{steps.versions.outputs.elixir}}
otp-version: ${{ steps.versions.outputs.erlang}}
- name: Restore dependencies cache
uses: buildjet/cache@v3
with:
path: |
deps
_build
priv/plts
key: ${{ runner.os }}-mix-v6-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-v6-
- name: Install dependencies
run: mix deps.get
- name: Check Formatting
run: mix format --check-formatted
- name: Check Compile Warnings
run: mix compile --warnings-as-errors --all-warnings
- name: Check Credo Warnings
run: mix credo --strict
- name: Write env file
run: |
touch .env.test
echo XTB_API_URL="${{ secrets.XTB_API_URL }}" >> .env.test
echo XTB_API_USERNAME="${{ secrets.XTB_API_USERNAME }}" >> .env.test
echo XTB_API_PASSWORD="${{ secrets.XTB_API_PASSWORD }}" >> .env.test
- name: Run tests
run: mix test --max-failures 1 --warnings-as-errors
- name: Check Dialyzer
run: mix dialyzer
env:
MIX_ENV: test