Skip to content

chore(ci): Automate Releases #1

chore(ci): Automate Releases

chore(ci): Automate Releases #1

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
name: Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
runs-on: ubuntu-24.04
strategy:
matrix:
elixir:
- "1.15"
- "1.16"
- "1.17"
- "1.18"
otp:
- "25"
- "26"
- "27"
# see https://hexdocs.pm/elixir/compatibility-and-deprecations.html#between-elixir-and-erlang-otp
exclude:
- elixir: 1.16
otp: 27
- elixir: 1.15
otp: 27
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Restore deps cache
uses: actions/cache@v4
with:
path: |
deps
_build
key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }}
restore-keys: |
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}
- name: Install package dependencies
run: mix deps.get
- name: Check Formatting
run: mix format --check-formatted
- name: Run unit tests
run: |
mix clean
mix test
- name: Run unit tests with persistent_term backend
run: |
mix clean
mix test
env:
SCHEMA_PROVIDER: persistent_term
- name: Cache/uncache PLTs
uses: actions/cache@v4
with:
path: |
priv/plts
key: "v1-${{ runner.os }}-\
erlang-${{ matrix.otp }}-\
elixir-${{ matrix.elixir }}-\
${{ hashFiles('mix.lock') }}"
- name: Run Dialyzer
run: mix dialyzer
release:
name: Create or Update Release PR
runs-on: ubuntu-latest
needs: [test]
if: github.ref == 'refs/heads/main'
permissions:
contents: write
pull-requests: write
steps:
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.ORG_GITHUB_TOKEN }}
release-type: elixir