Skip to content

Commit 5741d8a

Browse files
committed
cache plt
1 parent 6a5a333 commit 5741d8a

3 files changed

Lines changed: 34 additions & 2 deletions

File tree

.github/workflows/ci_v28.0.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,32 @@ jobs:
9090
otp-version: ${{matrix.otp}}
9191
elixir-version: ${{matrix.elixir}}
9292

93+
- name: Restore PLT cache
94+
id: plt_cache
95+
uses: actions/cache/restore@v4
96+
with:
97+
key: |
98+
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
99+
restore-keys: |
100+
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-
101+
path: |
102+
priv/plts
103+
if: ${{ matrix.lint }}
104+
105+
- name: Create PLTs
106+
if: ${{ steps.plt_cache.outputs.cache-hit != 'true' && matrix.lint }}
107+
run: mix dialyzer --plt
108+
109+
- name: Save PLT cache
110+
id: plt_cache_save
111+
uses: actions/cache/save@v4
112+
if: ${{ steps.plt_cache.outputs.cache-hit != 'true' && matrix.lint }}
113+
with:
114+
key: |
115+
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
116+
path: |
117+
priv/plts
118+
93119
- name: Cache dependencies/builds
94120
uses: actions/cache@v4
95121
with:
@@ -130,8 +156,8 @@ jobs:
130156
if: ${{ matrix.lint }}
131157

132158
- name: Dialyzer
133-
run: mix dialyzer
134-
if: ${{ matrix.lint && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
159+
run: mix dialyzer --format github --format dialyxir
160+
if: ${{ matrix.lint }}
135161

136162
- name: Run tests
137163
run: mix test --only ${{ matrix.typesense }}:true --trace

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ open_api_typesense-*.tar
3535
# Misc.
3636
.elixir_ls
3737
**.DS_Store
38+
39+
/priv/plts/*.plt
40+
/priv/plts/*.plt.hash

mix.exs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ defmodule OpenApiTypesense.MixProject do
2020
"coveralls.post": :test,
2121
"coveralls.html": :test
2222
],
23+
dialyzer: [
24+
plt_file: {:no_warn, "priv/plts/project.plt"}
25+
],
2326
description:
2427
"Restful client for Typesense with adherence to Open API spec 3 (formerly Swagger)",
2528
docs: docs(),

0 commit comments

Comments
 (0)