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-
15+ services :
16+ eventstore :
17+ image : ghcr.io/eventstore/eventstore:ci
18+ ports :
19+ - ' 2113:2113'
20+ env :
21+ EVENTSTORE_START_STANDARD_PROJECTIONS : True
22+ EVENTSTORE_RUN_PROJECTIONS : All
23+ EVENTSTORE_INSECURE : True
1624 steps :
1725 - name : Checkout
1826 uses : actions/checkout@v3
1927
20- - name : Spawn docker-compose EventStoreDB container
21- run : docker-compose up --detach eventstore
22-
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+ # - name: Spawn docker-compose EventStoreDB container
29+ # run: docker-compose up --detach eventstore
2830
2931 - name : Setup Elixir and Erlang versions
3032 uses : erlef/setup-beam@v1
33+ id : beam
3134 with :
32- otp- version: ${{ env.OTP_VERSION }}
33- elixir- version: ${{ env.ELIXIR_VERSION }}
35+ version-file : .tool-versions
36+ version-type : strict
3437
3538 - name : Restore the deps cache
3639 uses : actions/cache@v3
3740 id : deps-cache
3841 with :
42+ key : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-deps
43+ restore-keys : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-deps
3944 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-
4345
4446 - name : Restore the _build cache
4547 uses : actions/cache@v3
4648 id : build-cache
4749 with :
50+ key : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-${{ env.MIX_ENV }}-build
51+ restore-keys : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-${{ env.MIX_ENV }}-build
4852 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-
5253
5354 - name : Fetch mix dependencies
5455 if : steps.deps-cache.outputs.cache-hit != 'true'
7576 - name : Credo
7677 run : mix credo
7778
79+ - name : Restore PLT cache
80+ uses : actions/cache/restore@v3
81+ id : plt-cache
82+ with :
83+ key : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
84+ restore-keys : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
85+ path : priv/plts
86+
87+ - name : Create PLTs
88+ shell : sh
89+ if : steps.plt-cache.outputs.cache-hit != 'true'
90+ run : mix dialyzer --plt
91+
92+ - name : Save PLT cache
93+ uses : actions/cache/save@v3
94+ if : steps.plt-cache.outputs.cache-hit != 'true'
95+ with :
96+ key : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
97+ path : priv/plts
98+
99+ - name : Run dialyzer
100+ run : mix dialyzer --format github
101+
78102 publish-hex-package :
79103 name : Publish Hex Package ⬆️☁️
80104 runs-on : ubuntu-20.04
@@ -88,35 +112,28 @@ jobs:
88112 - name : Checkout
89113 uses : actions/checkout@v3
90114
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-
97115 - name : Setup Elixir and Erlang versions
98116 uses : erlef/setup-beam@v1
117+ id : beam
99118 with :
100- otp- version: ${{ env.OTP_VERSION }}
101- elixir- version: ${{ env.ELIXIR_VERSION }}
119+ version-file : .tool-versions
120+ version-type : strict
102121
103122 - name : Restore the deps cache
104123 uses : actions/cache@v3
105124 id : deps-cache
106125 with :
126+ key : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-deps
127+ restore-keys : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-deps
107128 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-
111129
112130 - name : Restore the _build cache
113131 uses : actions/cache@v3
114132 id : build-cache
115133 with :
134+ key : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-${{ env.MIX_ENV }}-build
135+ restore-keys : ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-${{ env.MIX_ENV }}-build
116136 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-
120137
121138 - name : Fetch mix dependencies
122139 if : steps.deps-cache.outputs.cache-hit != 'true'
0 commit comments