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
187 changes: 0 additions & 187 deletions .circleci/config.yml

This file was deleted.

106 changes: 106 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Elixir CI

on:
push:
branches:
- main
- hotfix/[0-9]+.[0-9]+.[0-9]+
- release/[0-9]+.[0-9]+.[0-9]+
tags:
- "*"
pull_request:
types: [synchronize, opened, reopened]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: test (${{ matrix.elixir }}-erlang-${{ matrix.erlang }})
runs-on: ubuntu-latest
env:
MIX_ENV: test
strategy:
fail-fast: false
matrix:
include:
- elixir: "1.19.2"
erlang: "28.1.1"
latest: true
- elixir: "1.18.4"
erlang: "27.3.4.4"
latest: false

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.erlang }}

- name: Install lrzsz
run: sudo apt-get update && sudo apt-get install -y lrzsz

- name: Restore deps/build cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.erlang }}-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.erlang }}-

- name: Restore Dialyzer PLT cache (latest only)
if: matrix.latest
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: _build/plts
key: ${{ runner.os }}-plt-${{ matrix.elixir }}-${{ matrix.erlang }}-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-plt-${{ matrix.elixir }}-${{ matrix.erlang }}-

- run: mix deps.get

- run: mix compile --warnings-as-errors

- run: mix test

- name: Quality checks (latest only)
if: matrix.latest
run: |
mix deps.unlock --check-unused
mix format --check-formatted
mix credo -a
mix dialyzer

- name: Docs + hex build (latest only)
if: matrix.latest
run: |
mix deps.get
mix docs --warnings-as-errors
mix hex.build
env:
MIX_ENV: docs

spelling_and_markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0

- name: Install cspell and markdownlint-cli2
run: npm i -g cspell markdownlint-cli2

- name: Spell check
run: cspell --quiet .

- name: Lint markdown files
run: markdownlint-cli2
55 changes: 55 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: write # required for `gh release create` via the built-in GITHUB_TOKEN

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Verify matching version in CHANGELOG.md, tag, and mix.exs
run: |
VERSION=$(sed -n 's/.*@version "\([^"]*\)".*/\1/p' mix.exs)
if ! grep -q "## \[v$VERSION\]" CHANGELOG.md; then
echo "Error: Version v$VERSION not found in CHANGELOG.md"
exit 1
fi
TAG_VERSION=${GITHUB_REF_NAME#v}
if [ "$TAG_VERSION" != "$VERSION" ]; then
echo "Error: Tag version ($TAG_VERSION) does not match mix.exs version ($VERSION)"
exit 1
fi

- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
awk -v ver="${GITHUB_REF_NAME}" '/^#+ \[/ { if (p) { exit }; if ($2 == "["ver"]") { p=1; next} } p && NF' CHANGELOG.md > release-notes.md
gh release create "${GITHUB_REF_NAME}" \
--title "${GITHUB_REF_NAME}" \
-F release-notes.md \
--repo "${GITHUB_REPOSITORY}"

- uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1
with:
elixir-version: "1.19.2"
otp-version: "28.1.1"

- name: Publish to Hex
env:
MIX_ENV: docs
HEX_API_KEY: ${{ secrets.HEX_API_WRITE_KEY }}
run: |
mix deps.get
mix hex.publish --yes