[2023-04] Small optimization #103
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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
env: | |
MIX_ENV: 'test' | |
steps: | |
- uses: actions/checkout@v4 | |
- id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: '1.16' | |
otp-version: '26' | |
- id: mix-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
_build | |
deps | |
key: mix-${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.output.otp-version }}-${{ hashFiles('**/mix.lock') }} | |
- id: plt-cache | |
uses: actions/cache@v3 | |
with: | |
path: _build/${{env.MIX_ENV}}/dialyxir_* | |
key: plt-${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }} | |
- run: mix do deps.get --only, deps.compile | |
if: steps.mix-cache.outputs.cache-hit != 'true' | |
- run: mix format --check-formatted | |
- run: mix credo suggest --strict --format oneline | |
- run: mix deps.unlock --check-unused | |
- run: mix compile --warnings-as-errors | |
- run: mix test --cover --export-coverage ci --trace --warnings-as-errors | |
- name: Coveralls | |
run: mix coveralls.github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create PLTs | |
if: steps.plt-cache.outputs.cache-hit != 'true' | |
run: mix dialyzer --plt --format github | |
- run: mix dialyzer --format github |