Update actions/cache #171
This file contains 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
on: push | |
name: Continuous Integration | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
otp: ["25.2.3"] | |
elixir: ["1.14.3"] | |
env: | |
MIX_ENV: test | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache dialyzer plts | |
uses: actions/cache@v4 | |
with: | |
path: priv/plts | |
key: ${{runner.os}}-${{matrix.otp}}-${{matrix.elixir}}-plts | |
- uses: erlef/setup-elixir@v1 | |
with: | |
otp-version: ${{matrix.otp}} | |
elixir-version: ${{matrix.elixir}} | |
- name: Deps get | |
run: mix deps.get | |
- name: Check Credo | |
run: mix credo --strict | |
- name: Check Formatting | |
run: mix format --check-formatted | |
- name: Newline linter | |
run: | | |
set -e; \ | |
code=0; \ | |
for f in $( find . -type f \( -iname '*.ex' -o -iname '*.eex' -o -iname '*.exs' \) | grep -v "^./deps/" ); do \ | |
if [ "$(tail -c 1 $f)" != "$(printf '\n')" ]; then \ | |
echo "$f does not end with a newline"; \ | |
code=1; \ | |
fi; \ | |
done; \ | |
exit $code | |
- name: Multi newline linter | |
run: | | |
set -e; \ | |
code=0; \ | |
for f in $( find . -type f \( -iname '*.ex' -o -iname '*.eex' -o -iname '*.exs' \) | grep -v "^./deps/" ); do \ | |
if [ "$(tail -c 2 $f)" == "$(printf '\n\n')" ]; then \ | |
echo "$f has trailing newlines"; \ | |
code=1; \ | |
fi; \ | |
done; \ | |
exit $code | |
- name: Run Tests | |
run: mix do compile --warnings-as-errors, test | |
- name: Dialyzer | |
run: mix dialyzer |