66
77jobs :
88 bless :
9- name : Bless
9+ name : Quality Assurance
1010 runs-on : ubuntu-20.04
1111 env :
1212 MIX_ENV : test
1313 EVENTSTORE_HOST : localhost
1414 EVENTSTORE_VERSION : nightly
15-
1615 steps :
1716 - name : Checkout
1817 uses : actions/checkout@v3
1918
2019 - name : Spawn docker-compose EventStoreDB container
2120 run : docker-compose up --detach eventstore
2221
23- - name : Determine the elixir version
24- run : echo "ELIXIR_VERSION=$(grep -h elixir .tool-versions | awk '{ print $2 }' | awk -F - '{print $1}')" >> $GITHUB_ENV
25-
26- - name : Determine the otp version
27- run : echo "OTP_VERSION=$(grep -h erlang .tool-versions | awk '{ print $2 }')" >> $GITHUB_ENV
28-
2922 - name : Setup Elixir and Erlang versions
3023 uses : erlef/setup-beam@v1
24+ id : beam
3125 with :
32- otp- version: ${{ env.OTP_VERSION }}
33- elixir- version: ${{ env.ELIXIR_VERSION }}
26+ version-file : .tool-versions
27+ version-type : strict
3428
3529 - name : Restore the deps cache
3630 uses : actions/cache@v3
3731 id : deps-cache
3832 with :
33+ key : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-deps
34+ restore-keys : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-deps
3935 path : deps
40- key : ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
41- restore-keys : |
42- ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-
4336
4437 - name : Restore the _build cache
4538 uses : actions/cache@v3
4639 id : build-cache
4740 with :
41+ key : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-${{ env.MIX_ENV }}-build
42+ restore-keys : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-${{ env.MIX_ENV }}-build
4843 path : _build
49- key : ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-build-mixlockhash-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
50- restore-keys : |
51- ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-build-
5244
5345 - name : Fetch mix dependencies
5446 if : steps.deps-cache.outputs.cache-hit != 'true'
7567 - name : Credo
7668 run : mix credo
7769
70+ - name : Restore PLT cache
71+ uses : actions/cache/restore@v3
72+ id : plt-cache
73+ with :
74+ key : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
75+ restore-keys : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
76+ path : priv/plts
77+
78+ - name : Create PLTs
79+ shell : sh
80+ if : steps.plt-cache.outputs.cache-hit != 'true'
81+ run : mix dialyzer --plt
82+
83+ - name : Save PLT cache
84+ uses : actions/cache/save@v3
85+ if : steps.plt-cache.outputs.cache-hit != 'true'
86+ with :
87+ key : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
88+ path : priv/plts
89+
90+ - name : Run dialyzer
91+ run : mix dialyzer --format github
92+
7893 publish-hex-package :
7994 name : Publish Hex Package ⬆️☁️
8095 runs-on : ubuntu-20.04
@@ -88,35 +103,28 @@ jobs:
88103 - name : Checkout
89104 uses : actions/checkout@v3
90105
91- - name : Determine the elixir version
92- run : echo "ELIXIR_VERSION=$(grep -h elixir .tool-versions | awk '{ print $2 }' | awk -F - '{print $1}')" >> $GITHUB_ENV
93-
94- - name : Determine the otp version
95- run : echo "OTP_VERSION=$(grep -h erlang .tool-versions | awk '{ print $2 }')" >> $GITHUB_ENV
96-
97106 - name : Setup Elixir and Erlang versions
98107 uses : erlef/setup-beam@v1
108+ id : beam
99109 with :
100- otp- version: ${{ env.OTP_VERSION }}
101- elixir- version: ${{ env.ELIXIR_VERSION }}
110+ version-file : .tool-versions
111+ version-type : strict
102112
103113 - name : Restore the deps cache
104114 uses : actions/cache@v3
105115 id : deps-cache
106116 with :
117+ key : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-deps
118+ restore-keys : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-deps
107119 path : deps
108- key : ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
109- restore-keys : |
110- ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-
111120
112121 - name : Restore the _build cache
113122 uses : actions/cache@v3
114123 id : build-cache
115124 with :
125+ key : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-${{ env.MIX_ENV }}-build
126+ restore-keys : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-${{ env.MIX_ENV }}-build
116127 path : _build
117- key : ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-build-mixlockhash-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
118- restore-keys : |
119- ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-build-
120128
121129 - name : Fetch mix dependencies
122130 if : steps.deps-cache.outputs.cache-hit != 'true'
0 commit comments