Merge pull request #5 from benstepp/bs/issues #60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
permissions: | |
contents: read | |
env: | |
MIX_ENV: 'test' | |
ELIXIR_VERSION: '1.15.4' | |
OTP_VERSION: '26.0.2' | |
jobs: | |
compile: | |
name: Compile | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/compile-elixir | |
format: | |
name: mix format | |
runs-on: ubuntu-latest | |
needs: [compile] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/compile-elixir | |
- name: mix format | |
run: mix format --check-formatted | |
credo: | |
name: mix credo | |
runs-on: ubuntu-latest | |
needs: [compile] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/compile-elixir | |
- name: mix credo | |
run: mix credo | |
dialyzer: | |
name: mix dialyzer | |
runs-on: ubuntu-latest | |
needs: [compile] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/compile-elixir | |
- name: mix dialyzer | |
run: MIX_ENV=dev mix dialyzer | |
docs: | |
name: mix docs | |
runs-on: ubuntu-latest | |
needs: [compile] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/compile-elixir | |
- name: mix docs | |
run: MIX_ENV=dev mix docs | |
test: | |
name: mix test | |
runs-on: ubuntu-latest | |
needs: [compile] | |
services: | |
postgres: | |
image: postgres:14 | |
env: | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- '5432:5432' | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/compile-elixir | |
- name: mix test | |
env: | |
DATABASE_URL: 'ecto://postgres:postgres@localhost/ecto_ksuid_test' | |
run: mix test --cover | |
prettier: | |
name: prettier | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install prettier | |
run: npm install -g --silent prettier prettier-plugin-sh | |
- name: prettier | |
run: npx prettier --check . |