Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates & Test Runner #117

Merged
merged 19 commits into from
Feb 10, 2024
Merged
4 changes: 4 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Used by "mix format"
[
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]
72 changes: 72 additions & 0 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Elixir CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:
name: Build and test
runs-on: ubuntu-latest

env:
MIX_ENV: test
PGUSER: postgres
PGPASSWORD: postgres

services:
db:
image: postgres
ports: ['5432:5432']
env:
POSTGRES_DB: moebius_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3

- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
version-type: strict
version-file: .tool-versions

- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-

- name: Install dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get

- name: Set up test data
run: |
mix moebius.migrate
mix moebius.seed

- name: Check warnings
run: |
mix compile --warnings-as-errors

- name: Run tests
run: |
mix test

- name: Check code quality, security and format
run: |
mix quality --strict
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ db.sql
*.DS_Store

/*.beam

.elixir_ls/

# VSCode
.vscode/

# .DS_Store files from macOS
.DS_Store
**/.DS_Store
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
erlang 26.1.2
elixir 1.15.7-otp-26
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

Loading
Loading