philomena/.github/workflows/elixir.yml
2020-07-28 16:56:26 -04:00

54 lines
1.2 KiB
YAML

name: Philomena Build
on: push
jobs:
build:
runs-on: ubuntu-latest
container:
image: elixir:1.10.3
services:
db:
image: postgres:latest
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: 'postgres'
POSTGRES_USER: 'postgres'
POSTGRES_DB: 'philomena_test'
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
elasticsearch:
image: elasticsearch:7.6.2
ports: ['9200:9200']
redis:
image: redis:5.0.9
ports: ['6379:6379']
steps:
- uses: actions/checkout@v1
- name: Install Ubuntu Dependencies
run: |
apt-get update
apt-get -yqq install libpq-dev postgresql-client
- name: Install Dependencies
env:
MIX_ENV: 'test'
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Run Tests
env:
MIX_ENV: 'test'
PGUSER: 'postgres'
PGPASSWORD: 'postgres'
PGDATABASE: 'philomena_test'
PGPORT: 5432
PGHOST: db
run: |
mix ecto.create
mix ecto.load
mix reindex_all
mix test