BC Checkout #426
Workflow file for this run
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: Continuous Integration | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
push: | |
branches: | |
- "!master" | |
- "!staging" | |
jobs: | |
Test: | |
runs-on: ubuntu-latest | |
container: | |
image: elixir:1.13.3-slim | |
services: | |
redis: redis:alpine | |
mysql: | |
image: mysql:5.7.24 | |
env: | |
MYSQL_DATABASE: recognizer_test | |
MYSQL_ROOT_PASSWORD: recognizer | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Install (os) | |
run: apt-get update && apt-get install -y build-essential ca-certificates git libmcrypt-dev | |
- name: Install (mix) | |
run: | | |
mix local.rebar --force | |
mix local.hex --force | |
- name: Cache | |
uses: actions/cache@v2 | |
id: cache | |
with: | |
key: elixir-${{ hashFiles('Dockerfile', 'mix.lock') }}-${{ github.ref }}-test | |
restore-keys: | | |
elixir-${{ hashFiles('Dockerfile', 'mix.lock') }}-${{ github.ref }}- | |
elixir-${{ hashFiles('Dockerfile', 'mix.lock') }}- | |
elixir- | |
path: | | |
_build | |
deps | |
- name: Install (deps) | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: mix deps.get | |
- name: Compilation | |
run: mix compile --force --warnings-as-errors | |
- name: Test | |
run: mix test | |
env: | |
DB_HOST: mysql | |
REDIS_HOST: redis | |
Format: | |
runs-on: ubuntu-latest | |
container: | |
image: elixir:1.13.3-slim | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Install (os) | |
run: apt-get update && apt-get install -y build-essential ca-certificates git libmcrypt-dev | |
- name: Install (mix) | |
run: | | |
mix local.rebar --force | |
mix local.hex --force | |
mix deps.get | |
- name: Format | |
run: mix format --check-formatted | |
Credo: | |
runs-on: ubuntu-latest | |
container: | |
image: elixir:1.13.3-slim | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Install (os) | |
run: apt-get update && apt-get install -y build-essential ca-certificates git libmcrypt-dev | |
- name: Install (mix) | |
run: | | |
mix local.rebar --force | |
mix local.hex --force | |
- name: Cache | |
uses: actions/cache@v2 | |
id: cache | |
with: | |
key: elixir-${{ hashFiles('Dockerfile', 'mix.lock') }}-${{ github.ref }}-credo | |
restore-keys: | | |
elixir-${{ hashFiles('Dockerfile', 'mix.lock') }}-${{ github.ref }}- | |
elixir-${{ hashFiles('Dockerfile', 'mix.lock') }}- | |
elixir- | |
path: | | |
_build | |
deps | |
- name: Install (deps) | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: mix deps.get | |
- name: Credo | |
run: mix credo |