Clean elixir #71
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: Test | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
otp: ['24', '25', '26', '27'] | ||
elixir: ['1.13.4', '1.14.5', '1.15.7', '1.16.3', '1.17.2'] | ||
# https://hexdocs.pm/elixir/compatibility-and-deprecations.html | ||
exclude: | ||
- otp: '24' | ||
elixir: '1.17.2' | ||
- otp: '27' | ||
elixir: '1.16.3' | ||
- otp: '27' | ||
elixir: '1.15.7' | ||
- otp: '27' | ||
elixir: '1.14.5' | ||
- otp: '26' | ||
elixir: '1.14.5' | ||
- otp: '27' | ||
elixir: '1.13.4' | ||
- otp: '26' | ||
elixir: '1.13.4' | ||
env: | ||
MIX_ENV: test | ||
steps: | ||
- name: Check out source | ||
uses: actions/checkout@v4 | ||
- name: Install Erlang and Elixir | ||
uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: ${{matrix.otp}} | ||
elixir-version: ${{matrix.elixir}} | ||
# Could be 'latest' | ||
rebar3-version: '3.23.0' | ||
- name: Retrieve cached deps | ||
uses: actions/cache@v4 | ||
with: | ||
path: _build | ||
key: ${{ matrix.otp }}-${{ matrix.elixir}}-${{ hashFiles('**/rebar.lock') }} | ||
restore-keys: ${{ matrix.otp }}-${{ matrix.elixir }}- | ||
# Force full recompile on builds that are retried. | ||
- name: Clean deps to avoid flaky incremental builds | ||
working-directory: app | ||
if: github.run_attempt != '1' | ||
run: rm -rf _build | ||
- name: Check formatting | ||
run: rebar3 format -v | ||
- name: Run Erlang tests | ||
run: rebar3 ct | ||
- name: Cache deps | ||
working-directory: mix_tests | ||
id: cache-deps | ||
uses: actions/cache@v4 | ||
Check failure on line 72 in .github/workflows/test.yml GitHub Actions / TestInvalid workflow file
|
||
env: | ||
cache-name: cache-elixir-deps | ||
with: | ||
path: app/deps | ||
key: ${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-mix-${{ env.cache-name }}- | ||
- name: Cache compiled build | ||
working-directory: mix_tests | ||
id: cache-build | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: cache-compiled-build | ||
with: | ||
path: app/_build | ||
key: ${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-mix-${{ env.cache-name }}- | ||
- name: Install Elixir tools | ||
working-directory: mix_tests | ||
run: mix do local.rebar --force, local.hex --force | ||
# Force full recompile on builds that are retried. | ||
- name: Clean deps to avoid flaky incremental builds | ||
working-directory: mix_tests | ||
if: github.run_attempt != '1' | ||
run: | | ||
mix deps.clean --all | ||
mix clean | ||
shell: sh | ||
- name: Get Elixir deps | ||
working-directory: mix_tests | ||
run: mix deps.get | ||
- name: Run Elixir tests | ||
working-directory: mix_tests | ||
run: mix test | ||
- name: Run static code analysis checks | ||
run: rebar3 dialyzer |