Release 0.1.2 #12
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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
compile: | |
name: Install deps and compile | |
runs-on: ${{ matrix.versions.runner-image }} | |
strategy: | |
fail-fast: false | |
matrix: | |
versions: | |
- elixir: 1.11 | |
otp: 21.3 | |
runner-image: ubuntu-20.04 | |
- elixir: 1.17 | |
otp: 27.0 | |
runner-image: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.versions.elixir }} | |
otp-version: ${{ matrix.versions.otp }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
_build | |
deps | |
key: mix-${{ matrix.versions.runner-image }}-${{ matrix.versions.otp }}-${{ matrix.versions.elixir }}-${{ github.sha }} | |
restore-keys: | | |
mix-${{ matrix.versions.runner-image }}- | |
- name: Install Elixir dependencies | |
env: | |
MIX_ENV: test | |
run: mix deps.get | |
- name: Compile | |
env: | |
MIX_ENV: test | |
run: mix compile | |
credo: | |
needs: compile | |
name: Credo | |
runs-on: ${{ matrix.versions.runner-image }} | |
strategy: | |
fail-fast: false | |
matrix: | |
versions: | |
- elixir: 1.11 | |
otp: 21.3 | |
runner-image: ubuntu-20.04 | |
- elixir: 1.17 | |
otp: 27.0 | |
runner-image: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.versions.elixir }} | |
otp-version: ${{ matrix.versions.otp }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
_build | |
deps | |
key: mix-${{ matrix.versions.runner-image }}-${{ matrix.versions.otp }}-${{ matrix.versions.elixir }}-${{ github.sha }} | |
restore-keys: | | |
mix-${{ matrix.versions.runner-image }}- | |
- name: Check code style | |
env: | |
MIX_ENV: test | |
run: mix credo --strict | |
deps_audit: | |
needs: compile | |
name: Deps audit | |
runs-on: ${{ matrix.versions.runner-image }} | |
strategy: | |
fail-fast: false | |
matrix: | |
versions: | |
- elixir: 1.11 | |
otp: 21.3 | |
runner-image: ubuntu-20.04 | |
- elixir: 1.17 | |
otp: 27.0 | |
runner-image: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.versions.elixir }} | |
otp-version: ${{ matrix.versions.otp }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
_build | |
deps | |
key: mix-${{ matrix.versions.runner-image }}-${{ matrix.versions.otp }}-${{ matrix.versions.elixir }}-${{ github.sha }} | |
restore-keys: | | |
mix-${{ matrix.versions.runner-image }}- | |
- name: Check for vulnerable Mix dependencies | |
env: | |
MIX_ENV: test | |
run: mix deps.audit | |
dialyzer: | |
needs: compile | |
name: Dialyzer | |
runs-on: ${{ matrix.versions.runner-image }} | |
strategy: | |
fail-fast: false | |
matrix: | |
versions: | |
- elixir: 1.11 | |
otp: 21.3 | |
runner-image: ubuntu-20.04 | |
- elixir: 1.17 | |
otp: 27.0 | |
runner-image: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.versions.elixir }} | |
otp-version: ${{ matrix.versions.otp }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
_build | |
deps | |
key: mix-${{ matrix.versions.runner-image }}-${{ matrix.versions.otp }}-${{ matrix.versions.elixir }}-${{ github.sha }} | |
restore-keys: | | |
mix-${{ matrix.versions.runner-image }}- | |
- name: Restore PLT cache | |
uses: actions/cache@v3 | |
with: | |
path: priv/plts | |
key: plt-${{ matrix.versions.runner-image }}-${{ matrix.versions.otp }}-${{ matrix.versions.elixir }}-${{ github.sha }} | |
restore-keys: | | |
plt-${{ matrix.versions.runner-image }}- | |
- name: Create PLTs | |
env: | |
MIX_ENV: test | |
run: mix dialyzer --plt | |
- name: Run dialyzer | |
env: | |
MIX_ENV: test | |
run: mix dialyzer | |
format: | |
needs: compile | |
name: Format | |
runs-on: ${{ matrix.versions.runner-image }} | |
strategy: | |
fail-fast: false | |
matrix: | |
versions: | |
- elixir: 1.11 | |
otp: 21.3 | |
runner-image: ubuntu-20.04 | |
- elixir: 1.17 | |
otp: 27.0 | |
runner-image: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.versions.elixir }} | |
otp-version: ${{ matrix.versions.otp }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
_build | |
deps | |
key: mix-${{ matrix.versions.runner-image }}-${{ matrix.versions.otp }}-${{ matrix.versions.elixir }}-${{ github.sha }} | |
restore-keys: | | |
mix-${{ matrix.versions.runner-image }}- | |
- name: Check Elixir formatting | |
env: | |
MIX_ENV: test | |
run: mix format --check-formatted | |
hex_audit: | |
needs: compile | |
name: Hex audit | |
runs-on: ${{ matrix.versions.runner-image }} | |
strategy: | |
fail-fast: false | |
matrix: | |
versions: | |
- elixir: 1.11 | |
otp: 21.3 | |
runner-image: ubuntu-20.04 | |
- elixir: 1.17 | |
otp: 27.0 | |
runner-image: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.versions.elixir }} | |
otp-version: ${{ matrix.versions.otp }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
_build | |
deps | |
key: mix-${{ matrix.versions.runner-image }}-${{ matrix.versions.otp }}-${{ matrix.versions.elixir }}-${{ github.sha }} | |
restore-keys: | | |
mix-${{ matrix.versions.runner-image }}- | |
- name: Check for retired Hex packages | |
env: | |
MIX_ENV: test | |
run: mix hex.audit | |
prettier: | |
name: Check formatting using Prettier | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Restore npm cache | |
uses: actions/cache@v3 | |
id: npm-cache | |
with: | |
path: ~/.npm | |
key: npm-ubuntu-latest | |
- name: Install Prettier | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
run: npm i -g prettier | |
- name: Run Prettier | |
run: npx prettier -c . | |
test: | |
needs: compile | |
name: Test | |
runs-on: ${{ matrix.versions.runner-image }} | |
strategy: | |
fail-fast: false | |
matrix: | |
versions: | |
- elixir: 1.11 | |
otp: 21.3 | |
runner-image: ubuntu-20.04 | |
- elixir: 1.17 | |
otp: 27.0 | |
runner-image: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.versions.elixir }} | |
otp-version: ${{ matrix.versions.otp }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
_build | |
deps | |
key: mix-${{ matrix.versions.runner-image }}-${{ matrix.versions.otp }}-${{ matrix.versions.elixir }}-${{ github.sha }} | |
restore-keys: | | |
mix-${{ matrix.versions.runner-image }}- | |
- name: Run tests | |
env: | |
MIX_ENV: test | |
run: mix test --cover --warnings-as-errors | |
unused_deps: | |
needs: compile | |
name: Check unused deps | |
runs-on: ${{ matrix.versions.runner-image }} | |
strategy: | |
fail-fast: false | |
matrix: | |
versions: | |
- elixir: 1.11 | |
otp: 21.3 | |
runner-image: ubuntu-20.04 | |
- elixir: 1.17 | |
otp: 27.0 | |
runner-image: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.versions.elixir }} | |
otp-version: ${{ matrix.versions.otp }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
_build | |
deps | |
key: mix-${{ matrix.versions.runner-image }}-${{ matrix.versions.otp }}-${{ matrix.versions.elixir }}-${{ github.sha }} | |
restore-keys: | | |
mix-${{ matrix.versions.runner-image }}- | |
- name: Check for unused Mix dependencies | |
env: | |
MIX_ENV: test | |
run: mix deps.unlock --check-unused |