update readme install #11
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: Elixir CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
check: | |
name: Code Healthcheck | |
runs-on: ubuntu-latest | |
services: | |
# Label used to access the service container | |
redis: | |
# Docker Hub image | |
image: redis | |
# Set health checks to wait until redis has started | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: '1.14.5' | |
otp-version: '24.3.4.10' | |
- name: Restore dependencies cache | |
uses: actions/cache@v3 | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix- | |
- name: Install dependencies | |
run: mix deps.get | |
# Cache key based on Erlang/Elixir version and the mix.lock hash | |
- name: Restore PLT cache | |
id: plt_cache | |
uses: actions/cache/restore@v3 | |
with: | |
key: | | |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}- | |
path: | | |
priv/plts | |
# Create PLTs if no cache was found | |
- name: Create PLTs | |
if: steps.plt_cache.outputs.cache-hit != 'true' | |
run: mix dialyzer --plt | |
# By default, the GitHub Cache action will only save the cache if all steps in the job succeed, | |
# so we separate the cache restore and save steps in case running dialyzer fails. | |
- name: Save PLT cache | |
id: plt_cache_save | |
uses: actions/cache/save@v3 | |
if: steps.plt_cache.outputs.cache-hit != 'true' | |
with: | |
key: | | |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }} | |
path: | | |
priv/plts | |
- name: Run checks | |
run: mix check | |
env: | |
# The hostname used to communicate with the Redis service container | |
REDIS_HOST: localhost | |
# The default Redis port | |
REDIS_PORT: 6379 |