Skip to content

Instantly share code, notes, and snippets.

@theguuholi
Created July 15, 2021 12:30
Show Gist options
  • Save theguuholi/67e42b6f66bc4578ee894cbd70b62100 to your computer and use it in GitHub Desktop.
Save theguuholi/67e42b6f66bc4578ee894cbd70b62100 to your computer and use it in GitHub Desktop.
name: CI
on: push
env:
SECRET_KEY_BASE: "KrVbpnTx/SBlnJkq/IQ+dK+OWP2dUkS98sk1y9l5+okoCU2N/kCJ2PNY1T6CS7/I"
AUTH0_CLIENT_ID: ""
AUTH0_CLIENT_SECRET: ""
HOST: "localhost"
jobs:
pipeline:
runs-on: ubuntu-latest
strategy:
matrix:
elixir: [1.11]
otp: [24.0]
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@885971a72ed1f9240973bd92ab57af8c1aa68f24
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- uses: actions/cache@v2
id: "mix-cache"
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install Mix Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
mix ecto.create
- name: ==> FORMAT
run: mix format --check-formatted
- name: ==> Credo Lint
run: mix credo
- name: ==> Document
run: mix docs
- name: ==> 🔎 Integrating test
run: mix coveralls.html --umbrella
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Retrieve PLT Cache
uses: actions/cache@v1
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Create PLTs
if: steps.plt-cache.outputs.cache-hit != 'true'
run: |
mkdir -p priv/plts
mix dialyzer --plt
- name: Run dialyzer
run: mix dialyzer --no-check --halt-exit-status
services:
pg:
image: postgres:12
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment