Update deps #20
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: Test & Audit | |
on: | |
push: | |
branches: | |
- main | |
- ci/* | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build_test: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- pair: | |
elixir: 1.15.8 | |
otp: 25.3.2.12 | |
- pair: | |
elixir: 1.17.2 | |
otp: 27.0 | |
name: Build Test | |
runs-on: ubuntu-22.04 | |
env: | |
MIX_ENV: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.pair.elixir }} | |
otp-version: ${{ matrix.pair.otp }} | |
version-type: strict | |
- name: Cache deps | |
uses: actions/cache@v4 | |
with: | |
path: deps | |
key: ${{ runner.os }}-test-deps-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Cache _build | |
uses: actions/cache@v4 | |
with: | |
path: _build | |
key: ${{ runner.os }}-test-build-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Install dependencies | |
run: mix deps.get | |
working-directory: . | |
- name: Compile for test | |
if: ${{ !matrix.allow_warnings }} | |
run: mix compile --force --warnings-as-errors | |
working-directory: . | |
- name: Compile for test | |
if: ${{ matrix.allow_warnings }} | |
run: mix compile --force | |
working-directory: . | |
build_dev: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- pair: | |
elixir: 1.15.8 | |
otp: 25.3.2.12 | |
- pair: | |
elixir: 1.17.2 | |
otp: 27.0 | |
name: Build Dev | |
runs-on: ubuntu-22.04 | |
env: | |
MIX_ENV: dev | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.pair.elixir }} | |
otp-version: ${{ matrix.pair.otp }} | |
version-type: strict | |
- name: Cache deps | |
uses: actions/cache@v4 | |
with: | |
path: deps | |
key: ${{ runner.os }}-dev-deps-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Cache _build | |
uses: actions/cache@v4 | |
with: | |
path: _build | |
key: ${{ runner.os }}-dev-build-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Install dependencies | |
run: mix deps.get | |
working-directory: . | |
- name: Compile for dev | |
if: ${{ !matrix.allow_warnings }} | |
run: mix compile --force --warnings-as-errors | |
working-directory: . | |
- name: Compile for dev | |
if: ${{ matrix.allow_warnings }} | |
run: mix compile --force | |
working-directory: . | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- pair: | |
elixir: 1.15.8 | |
otp: 25.3.2.12 | |
- pair: | |
elixir: 1.17.2 | |
otp: 27.0 | |
name: Test | |
needs: build_test | |
runs-on: ubuntu-22.04 | |
env: | |
MIX_ENV: test | |
services: | |
postgres: | |
image: postgres:16.4-alpine | |
env: | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.pair.elixir }} | |
otp-version: ${{ matrix.pair.otp }} | |
version-type: strict | |
- name: Cache deps | |
uses: actions/cache@v4 | |
with: | |
path: deps | |
key: ${{ runner.os }}-test-deps-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Cache _build | |
uses: actions/cache@v4 | |
with: | |
path: _build | |
key: ${{ runner.os }}-test-build-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Run tests | |
run: mix test --color --warnings-as-errors | |
working-directory: . | |
credo_and_dialyxir: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- pair: | |
elixir: 1.15.8 | |
otp: 25.3.2.12 | |
- pair: | |
elixir: 1.17.2 | |
otp: 27.0 | |
name: Credo + Dialyxir | |
needs: build_test | |
runs-on: ubuntu-22.04 | |
env: | |
MIX_ENV: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.pair.elixir }} | |
otp-version: ${{ matrix.pair.otp }} | |
version-type: strict | |
- name: Cache deps | |
uses: actions/cache@v4 | |
with: | |
path: deps | |
key: ${{ runner.os }}-test-deps-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Cache _build | |
uses: actions/cache@v4 | |
with: | |
path: _build | |
key: ${{ runner.os }}-test-build-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Cache PLTs | |
uses: actions/cache@v4 | |
with: | |
path: _build/plts | |
key: ${{ runner.os }}-test-dialyzer-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Credo | |
run: mix credo --strict | |
working-directory: . | |
- name: Run dialyzer | |
run: mix dialyzer | |
working-directory: . | |
docs: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- pair: | |
elixir: 1.17.2 | |
otp: 27.0 | |
name: Docs | |
needs: build_dev | |
runs-on: ubuntu-22.04 | |
env: | |
MIX_ENV: dev | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.pair.elixir }} | |
otp-version: ${{ matrix.pair.otp }} | |
version-type: strict | |
- name: Cache deps | |
uses: actions/cache@v4 | |
with: | |
path: deps | |
key: ${{ runner.os }}-dev-deps-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Cache _build | |
uses: actions/cache@v4 | |
with: | |
path: _build | |
key: ${{ runner.os }}-dev-build-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Check docs can build | |
run: mix docs | |
working-directory: . | |
audit: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- pair: | |
elixir: 1.17.2 | |
otp: 27.0 | |
name: Audit | |
needs: build_dev | |
runs-on: ubuntu-22.04 | |
env: | |
MIX_ENV: dev | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.pair.elixir }} | |
otp-version: ${{ matrix.pair.otp }} | |
version-type: strict | |
- name: Cache deps | |
uses: actions/cache@v4 | |
with: | |
path: deps | |
key: ${{ runner.os }}-dev-deps-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Cache _build | |
uses: actions/cache@v4 | |
with: | |
path: _build | |
key: ${{ runner.os }}-dev-build-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Check Elixir formatting | |
run: mix format --check-formatted | |
working-directory: . | |
- name: Check for unused dependencies | |
run: mix deps.unlock --check-unused | |
working-directory: . | |
- name: Audit deps | |
run: mix deps.audit | |
working-directory: . | |
audit_md: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: PurpleBooth/[email protected] | |
name: Check markdown formatting | |
publish: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- pair: | |
elixir: 1.17.2 | |
otp: 27.0 | |
name: Publish to Hex | |
if: github.ref == 'refs/heads/main' | |
needs: | |
- test | |
- credo_and_dialyxir | |
- audit | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.pair.elixir }} | |
otp-version: ${{ matrix.pair.otp }} | |
version-type: strict | |
- name: Cache deps | |
uses: actions/cache@v4 | |
with: | |
path: deps | |
key: ${{ runner.os }}-dev-deps-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Cache _build | |
uses: actions/cache@v4 | |
with: | |
path: _build | |
key: ${{ runner.os }}-dev-build-v1-${{ hashFiles('**/mix.lock') }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- name: Publish to Hex | |
uses: synchronal/hex-publish-action@v3 | |
with: | |
name: ecto_email | |
key: ${{ secrets.HEX_PM_KEY }} |