Skip to content

Commit

Permalink
ci: 👷 add Elixir CI
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbarsukov committed Oct 10, 2024
1 parent 4520259 commit c155cdc
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Elixir CI

on:
push:
branches:
- master
paths:
- ".github/workflows/*"
- "**/*.ex"
- "**/*.exs"
- "**/*.eex"
- "mix.lock"
- "coveralls.json"
pull_request:
branches:
- master
paths:
- ".github/workflows/*"
- "**/*.ex"
- "**/*.exs"
- "**/*.eex"
- "mix.lock"
- "coveralls.json"

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
otp-version: '27.0.1'
elixir-version: '1.17.2'

- name: Restore deps cache
uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-deps-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }}
restore-keys: |
${{ runner.os }}-deps-${{ hashFiles('**/mix.lock') }}
${{ runner.os }}-deps
- name: Install package dependencies
run: mix deps.get

- name: Remove compiled application files
run: mix clean

- name: Compile dependencies
run: mix compile
env:
MIX_ENV: test

- name: Run tests
run: mix test --trace
env:
MIX_ENV: test

- name: Check code coverage
run: mix coveralls
env:
MIX_ENV: test

- name: Upload coverage to coveralls
run: mix coveralls.github
env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check code formatting
run: mix check

- name: Run Credo linter
run: mix credo --strict

0 comments on commit c155cdc

Please sign in to comment.