fixup! feature: initialize #3
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: Elixir CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
- "epic/**" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
mix: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | |
uses: byzanteam/jet-actions/setup-elixir@main | |
with: | |
version-file: .tool-versions | |
- name: Install Dependencies | |
run: mix do deps.get, deps.unlock --check-unused, deps.clean --unused | |
build: | |
runs-on: ubuntu-latest | |
needs: mix | |
steps: | |
- name: Setup | |
uses: byzanteam/jet-actions/setup-elixir@main | |
with: | |
version-file: .tool-versions | |
- name: Setup protoc | |
uses: arduino/setup-protoc@v3 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install elixir protobuf | |
run: mix escript.install --force hex protobuf | |
- name: Check formatting | |
run: mix format --check-formatted | |
- name: Check warnings | |
run: mix compile --warnings-as-errors | |
test: | |
runs-on: ubuntu-latest | |
needs: mix | |
services: | |
postgres: | |
image: postgres:15-alpine | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: jet_test | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Setup | |
uses: byzanteam/jet-actions/setup-elixir@main | |
with: | |
version-file: .tool-versions | |
- name: Setup protoc | |
uses: arduino/setup-protoc@v3 | |
- name: Install elixir protobuf | |
run: mix escript.install --force hex protobuf | |
- run: mix do ecto.create, ecto.migrate | |
env: | |
MIX_ENV: test | |
- name: Test | |
run: mix test | |
credo: | |
runs-on: ubuntu-latest | |
needs: mix | |
steps: | |
- name: Setup | |
uses: byzanteam/jet-actions/setup-elixir@main | |
with: | |
version-file: .tool-versions | |
- name: Credo | |
run: mix credo --strict | |
dialyzer: | |
runs-on: ubuntu-latest | |
needs: mix | |
steps: | |
- name: Setup | |
uses: byzanteam/jet-actions/setup-elixir@main | |
with: | |
version-file: .tool-versions | |
- name: Setup protoc | |
uses: arduino/setup-protoc@v2 | |
- name: Install elixir protobuf | |
run: mix escript.install --force hex protobuf | |
- uses: actions/cache@v4 | |
with: | |
path: priv/plts | |
key: ${{ runner.os }}-plt-${{ hashFiles('.tool-versions') }}-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
${{ runner.os }}-plt-${{ hashFiles('.tool-versions') }}- | |
- name: Dialyzer | |
run: mix dialyzer --format github |