Shared GitHub Actions and reusable workflows for Elixir Vibe and Elixir Volt projects.
How our repositories present themselves — README structure, badges, descriptions, cross-linking — is codified in README-STYLE.md.
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
permissions:
contents: read
jobs:
ci:
uses: elixir-vibe/actions/.github/workflows/elixir-ci.yml@v1The default CI runs:
- Elixir
1.20/ OTP29withmix ci - Elixir
1.19/ OTP27withmix compile --warnings-as-errors && mix test
Override commands when a repository needs custom checks:
jobs:
ci:
uses: elixir-vibe/actions/.github/workflows/elixir-ci.yml@v1
with:
latest-command: mix ci
min-command: mix compile --warnings-as-errors && mix testUse this for Elixir projects that build Rustler NIFs or run Cargo checks:
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
permissions:
contents: read
jobs:
ci:
uses: elixir-vibe/actions/.github/workflows/elixir-rustler-ci.yml@v1
with:
rust-toolchain: stable
rust-cache-workspaces: native/my_app_nif -> target
extra-env: |
MY_APP_BUILD=1For projects with submodules or Ubuntu system package dependencies, pass them through the workflow inputs:
jobs:
ci:
uses: elixir-vibe/actions/.github/workflows/elixir-rustler-ci.yml@v1
with:
checkout-submodules: recursive
apt-packages: libfontconfig1-dev libfreetype6-dev
rust-cache-workspaces: native/my_app_nif -> targetFor projects with multiple Rust crates, list each workspace:
jobs:
ci:
uses: elixir-vibe/actions/.github/workflows/elixir-rustler-ci.yml@v1
with:
rust-toolchain: "1.95.0"
rust-profile: default
rust-cache-workspaces: |
. -> target
native/my_app_lint_nif -> target
native/my_app_fmt_nif -> target
extra-env: |
MY_APP_BUILD=1Use this from tag-triggered release workflows that build rustler_precompiled archives:
name: Build precompiled NIFs
on:
push:
tags: ["v*"]
jobs:
build_release:
uses: elixir-vibe/actions/.github/workflows/elixir-rustler-release.yml@v1
with:
project-name: my_app_nifOverride jobs, nif-versions, project-dir, or cargo-args for repositories with custom target matrices. Native system dependencies and build-time environment variables are also centralized:
jobs:
build_release:
uses: elixir-vibe/actions/.github/workflows/elixir-rustler-release.yml@v1
permissions:
contents: write
id-token: write
attestations: write
artifact-metadata: write
with:
project-name: my_app_nif
apt-packages: libxkbcommon-dev libxkbcommon-x11-dev
extra-env: |
MY_APP_BUILD=1
attest-artifacts: trueFor a tagged rustler_precompiled release, the shared workflow can generate and attach the mandatory checksum after every matrix artifact has been published:
with:
project-name: my_app_nif
checksum-module: MyApp.Native
checksum-file: checksum-Elixir.MyApp.Native.exs
checksum-prepare-command: MY_APP_BUILD=1 mix compileChecksum generation only runs for tags and remains disabled unless both checksum inputs are provided.
Tagged releases also get their GitHub release notes from the changelog. After the builds finish, parse-changelog extracts the section of CHANGELOG.md for the tagged version, and it becomes the release body. The job fails if the changelog has no section for that version. Point changelog-file elsewhere, or set it to an empty string to opt out:
with:
project-name: my_app_nif
changelog-file: ""Use this when a repository needs custom jobs but wants the shared setup/cache steps:
steps:
- uses: actions/checkout@v4
- uses: elixir-vibe/actions/setup-elixir@v1
with:
elixir-version: "1.20"
otp-version: "29"
- run: mix ci