config: add cache to CI #30
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
name: lint | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
env: | |
MIX_ENV: test | |
jobs: | |
deps: | |
name: Restore Cached deps | |
run-ons: ubuntu-latest | |
steps: | |
- id: mix-deps-restore | |
uses: actions/cache/restore@v3 | |
with: | |
key: mix-deps | |
path: | | |
_build | |
deps | |
compile: | |
name: Check compile warning | |
run-ons: ubuntu-latest | |
needs: | |
- deps | |
strategy: | |
matrix: | |
elixir: [1.15.7] | |
otp: [26.1.2] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- run: mix compile --warnings-as-errors | |
format: | |
name: Code format | |
run-ons: ubuntu-latest | |
needs: | |
- deps | |
strategy: | |
matrix: | |
elixir: [1.15.7] | |
otp: [26.1.2] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: erlef/setup-elixir | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- run: mix format --check-formatted | |
credo: | |
name: Static Code Analysis | |
run-ons: ubuntu-latest | |
needs: | |
- deps | |
strategy: | |
matrix: | |
elixir: [1.15.7] | |
otp: [26.1.2] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: erlef/setup-elixir | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- run: mix credo --strict | |
dialyzer: | |
name: Dialyzer | |
run-ons: ubuntu-latest | |
needs: | |
- deps | |
strategy: | |
matrix: | |
elixir: [1.15.7] | |
otp: [26.1.2] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: erlef/setup-elixir | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- run: mix dialyzer --no-check |