Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Elixir API CI

on:
push:
paths:
- '.github/workflows/api.yml'
- 'api/*'

jobs:
build:
runs-on: ubuntu-latest

container:
image: elixir:1.9
env:
MIX_ENV: test
DATABASE_HOST: postgresql

services:
postgresql:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v1
- name: Install dependencies
working-directory: api/
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Setup database
working-directory: api/
run: |
mix ecto.create
mix ecto.migrate
- name: Run tests
working-directory: api/
run: |
mix format --check-formatted
mix test

deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v1
- name: Deploy to Gigalixir
# if: github.ref == 'refs/heads/master'
working-directory: api/
run: ./scripts/deploy.sh
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion api/config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ config :locationiser, Locationiser.Repo,
username: "postgres",
password: "postgres",
database: "locationiser_test",
hostname: "localhost",
hostname: System.get_env("DATABASE_HOST") || "localhost",
pool: Ecto.Adapters.SQL.Sandbox

# We don't run a server during test. If one is required,
Expand Down