mirror of
https://github.com/ClaperCo/Claper.git
synced 2025-12-16 03:47:56 +01:00
60 lines
1.5 KiB
YAML
60 lines
1.5 KiB
YAML
name: Elixir CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main", "dev" ]
|
|
tags: ['v*']
|
|
pull_request:
|
|
branches: [ "main", "dev" ]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
|
|
name: Build and test
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
db:
|
|
image: postgres:15
|
|
ports: ['5432:5432']
|
|
env:
|
|
POSTGRES_PASSWORD: claper
|
|
POSTGRES_USER: claper
|
|
POSTGRES_DB: claper
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
env:
|
|
ImageOS: ubuntu20
|
|
MIX_ENV: test
|
|
DATABASE_URL: postgresql://claper:claper@localhost:5432/claper
|
|
SECRET_KEY_BASE: QMQE4ypfy0IC1LZI/fygZNvXHPjLslnr49EE7ftcL1wgAC0MwMLdKCVJyrvXPu8z
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set up Elixir
|
|
uses: erlef/setup-beam@988e02bfe678367a02564f65ca2e37726dc0268f
|
|
with:
|
|
elixir-version: '1.15.4'
|
|
otp-version: '26'
|
|
- 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 deps.get
|
|
- name: Check Formatting
|
|
run: mix format --check-formatted
|
|
- name: Check Credo Warnings
|
|
run: mix credo diff --from-git-merge-base origin/main
|
|
- name: Run tests
|
|
run: mix test |