Skip to content

Commit

Permalink
Add github CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean Parpaillon committed Apr 4, 2024
1 parent d9b027b commit 1242171
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Elixir CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-22.04
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-elixir@v1
with:
elixir-version: '1.16.2-otp-26'
otp-version: '26.2.3'
- uses: actions/cache@v4
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- if: steps.mix-cache.outputs.cache-hit != 'true'
run: mix deps.get
- run: mix test

lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
elixir-version: '1.16.2-otp-26'
otp-version: '26.2.3'
- uses: erlef/setup-elixir@v1
with:
elixir-version: '1.16.2-otp-26'
otp-version: '26.2.3'
- uses: actions/cache@v4
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- if: steps.mix-cache.outputs.cache-hit != 'true'
run: mix deps.get
- run: mix format --check-formatted
- run: mix credo --strict
- uses: actions/cache@v4
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- if: steps.plt-cache.outputs.cache-hit != 'true'
run: |
mkdir -p priv/plts
mix dialyzer --plt
- run: mix dialyzer --no-check --halt-exit-status

0 comments on commit 1242171

Please sign in to comment.