Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export GPG_TTY="$(tty)"

# this allows mix to work on the local directory
export MIX_HOME=$PWD/.nix-mix
export HEX_HOME=$PWD/.nix-mix
export PATH=$MIX_HOME/bin:$HEX_HOME/bin:$PATH
export ERL_AFLAGS="-kernel shell_history enabled"

export LANG=en_US.UTF-8

use flake

if [ -f .env.dev ]; then
source .env.dev
fi
3 changes: 3 additions & 0 deletions .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0"
}
75 changes: 75 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"bootstrap-sha": "f471986",
"pull-request-header": ":rocket: Want to release this?",
"pull-request-title-pattern": "chore: release ${version}",
"changelog-sections": [
{
"type": "feat",
"section": "Features"
},
{
"type": "feature",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "revert",
"section": "Reverts"
},
{
"type": "docs",
"section": "Documentation",
"hidden": false
},
{
"type": "style",
"section": "Styles",
"hidden": false
},
{
"type": "chore",
"section": "Miscellaneous Chores",
"hidden": false
},
{
"type": "refactor",
"section": "Code Refactoring",
"hidden": false
},
{
"type": "test",
"section": "Tests",
"hidden": false
},
{
"type": "build",
"section": "Build System",
"hidden": false
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": false
}
],
"extra-files": [
{
"type": "generic",
"path": "README.md",
"glob": false
}
],
"packages": {
".": {
"release-type": "elixir"
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
61 changes: 33 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ jobs:

strategy:
matrix:
elixir: [1.18.1]
otp: [27.0]
include:
- elixir: 1.18
otp: 27
- elixir: 1.18
otp: 26

steps:
- name: Checkout code
Expand All @@ -31,14 +34,14 @@ jobs:
otp-version: ${{ matrix.otp }}

- name: Cache Elixir deps
uses: actions/cache@v1
uses: actions/cache@v4
id: deps-cache
with:
path: deps
key: ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}

- name: Cache Elixir _build
uses: actions/cache@v1
uses: actions/cache@v4
id: build-cache
with:
path: _build
Expand All @@ -64,16 +67,19 @@ jobs:
- name: Run Credo
run: mix credo --strict

static-analisys:
static-analysis:
runs-on: ubuntu-latest

env:
MIX_ENV: test

strategy:
matrix:
elixir: [1.18.1]
otp: [27.0]
include:
- elixir: 1.18
otp: 27
- elixir: 1.18
otp: 26

steps:
- name: Checkout code
Expand All @@ -86,14 +92,14 @@ jobs:
otp-version: ${{ matrix.otp }}

- name: Cache Elixir deps
uses: actions/cache@v1
uses: actions/cache@v4
id: deps-cache
with:
path: deps
key: ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}

- name: Cache Elixir _build
uses: actions/cache@v1
uses: actions/cache@v4
id: build-cache
with:
path: _build
Expand All @@ -110,29 +116,25 @@ jobs:
if: steps.build-cache.outputs.cache-hit != 'true'
run: mix deps.compile --warnings-as-errors

# Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones
# Cache key based on Elixir & Erlang version (also useful when running in matrix)
- name: Restore PLT cache
uses: actions/cache/restore@v3
# Ensure PLTs directory exists
- name: Create PLTs directory
run: mkdir -p priv/plts

# Cache PLTs based on Elixir & Erlang version + mix.lock hash
- name: Restore/Save PLT cache
uses: actions/cache@v4
id: plt_cache
with:
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
restore-keys: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
path: priv/plts
key: plt-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
restore-keys: |
plt-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-

# Create PLTs if no cache was found
- name: Create PLTs
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt

- name: Save PLT cache
uses: actions/cache/save@v3
if: steps.plt_cache.outputs.cache-hit != 'true'
id: plt_cache_save
with:
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
path: priv/plts

- name: Run dialyzer
run: mix dialyzer --format github

Expand All @@ -144,8 +146,11 @@ jobs:

strategy:
matrix:
elixir: [1.18.1]
otp: [27.0]
include:
- elixir: 1.18
otp: 27
- elixir: 1.18
otp: 26

steps:
- name: Checkout code
Expand All @@ -158,14 +163,14 @@ jobs:
otp-version: ${{ matrix.otp }}

- name: Cache Elixir deps
uses: actions/cache@v1
uses: actions/cache@v4
id: deps-cache
with:
path: deps
key: ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}

- name: Cache Elixir _build
uses: actions/cache@v1
uses: actions/cache@v4
id: build-cache
with:
path: _build
Expand All @@ -186,4 +191,4 @@ jobs:
run: mix clean

- name: Run tests
run: mix test
run: mix test --warnings-as-errors
25 changes: 25 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
on:
workflow_dispatch:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: Release Please

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
config-file: .github/release-please-config.json
manifest-file: .github/.release-please-manifest.json
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ supabase_functions-*.tar
/tmp/

/priv/plts/

.env.dev
79 changes: 74 additions & 5 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading