File tree Expand file tree Collapse file tree 4 files changed +42
-4
lines changed Expand file tree Collapse file tree 4 files changed +42
-4
lines changed Original file line number Diff line number Diff line change 16
16
version :
17
17
runs-on : ubuntu-latest
18
18
outputs :
19
+ elixir-version : ${{ steps.parse.outputs.elixir-version }}
20
+ otp-version : ${{ steps.parse.outputs.otp-version }}
19
21
previous-release-tag : ${{ steps.parse.outputs.previous-release-tag }}
20
22
releasable : ${{ steps.parse.outputs.releasable }}
21
23
semver : ${{ steps.parse.outputs.semver }}
@@ -38,13 +40,37 @@ jobs:
38
40
- run : mix test
39
41
40
42
audit :
43
+ needs : [ version ]
41
44
runs-on : ubuntu-latest
42
45
steps :
43
46
- uses : actions/checkout@v3
44
47
- uses : pkgxdev/dev@v0
45
48
- run : mix deps.get
46
- - run : mix e2e.update_examples_workflow --check
47
- - run : bin/format --check
49
+ - name : Restore PLT cache
50
+ id : plt_cache
51
+ uses : actions/cache/restore@v3
52
+ with :
53
+ key : |
54
+ plt-${{ runner.os }}-${{ needs.version.outputs.otp-version }}-${{ needs.version.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
55
+ restore-keys : |
56
+ plt-${{ runner.os }}-${{ needs.version.outputs.otp-version }}-${{ needs.version.outputs.elixir-version }}-
57
+ path : |
58
+ priv/plts
59
+ - name : Create PLTs
60
+ if : steps.plt_cache.outputs.cache-hit != 'true'
61
+ run : mix dialyzer --plt
62
+ # By default, the GitHub Cache action will only save the cache if all steps in the job succeed,
63
+ # so we separate the cache restore and save steps in case running dialyzer fails.
64
+ - name : Save PLT cache
65
+ id : plt_cache_save
66
+ uses : actions/cache/save@v3
67
+ if : steps.plt_cache.outputs.cache-hit != 'true'
68
+ with :
69
+ key : |
70
+ plt-${{ runner.os }}-${{ needs.version.outputs.otp-version }}-${{ needs.version.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
71
+ path : |
72
+ priv/plts
73
+ - run : bin/audit
48
74
49
75
build :
50
76
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -30,3 +30,7 @@ elixir_script-*.tar
30
30
31
31
# The compiled artifact
32
32
elixir_script
33
+
34
+ # Dialyzer
35
+ /priv /plts /* .plt
36
+ /priv /plts /* .plt.hash
Original file line number Diff line number Diff line change @@ -10,7 +10,11 @@ echo "Checking code formatting..."
10
10
bin/format --check
11
11
12
12
echo " Running static code analysis with dialyzer..."
13
- mix dialyzer
13
+ if [ " ${CI:- } " == " true" ]; then
14
+ mix dialyzer --format github
15
+ else
16
+ mix dialyzer
17
+ fi
14
18
15
19
echo " Checking code style with Credo..."
16
20
mix credo --strict
Original file line number Diff line number Diff line change @@ -8,7 +8,11 @@ defmodule ElixirScript.MixProject do
8
8
elixir: "~> 1.15" ,
9
9
escript: escript ( ) ,
10
10
deps: deps ( ) ,
11
- dialyzer: [ plt_add_apps: [ :mix ] ]
11
+ dialyzer: [
12
+ plt_add_apps: [ :mix ] ,
13
+ plt_core_path: "priv/plts/core.plt" ,
14
+ plt_local_path: "priv/plts/project.plt"
15
+ ]
12
16
]
13
17
end
14
18
You can’t perform that action at this time.
0 commit comments