Skip to content

Commit

Permalink
Add CI (ueberauth#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
juanvico committed Oct 13, 2020
1 parent f6253e3 commit 5d50ca5
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
66 changes: 66 additions & 0 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Elixir CI

on: push

jobs:
build:

runs-on: ubuntu-latest

container:
image: elixir:1.10.0-slim
env:
MIX_ENV: test

services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v1

- name: Install dependencies
run: |
apt update -y
apt-get update -y
apt install -y make
apt-get install -y build-essential
- name: Cache mix deps
uses: actions/cache@v1
with:
path: deps
key: ${{ runner.OS }}-mix-cache-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.OS }}-mix-cache-${{ env.cache-name }}-
${{ runner.OS }}-mix-cache-
${{ runner.OS }}-
- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
- name: Cache build
uses: actions/cache@v1
with:
path: _build
key: ${{ runner.OS }}-build-cache }}
restore-keys: |
${{ runner.OS }}-build-cache-
${{ runner.OS }}-
- name: Build
run: mix do deps.get, compile

- name: Check formatted
run: mix format --check-formatted
- name: Run Tests
run: mix test
env:
DB_HOST: postgres

2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ config :guardian, Guardian.Repo,
username: "postgres",
password: "postgres",
database: "guardian_test#{System.get_env("MIX_TEST_PARTITION")}",
hostname: "localhost",
hostname: System.get_env("DB_HOST", "localhost"),
pool: Ecto.Adapters.SQL.Sandbox

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

0 comments on commit 5d50ca5

Please sign in to comment.