Bump apps version in GitHub CI #100
Workflow file for this run
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: | |
push: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
services: | |
postgres: | |
image: postgres | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_DB: dataloader_test | |
POSTGRES_PASSWORD: postgres | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- pair: | |
elixir: 1.11.4 | |
otp: 22.3 | |
- pair: | |
elixir: 1.15.7 | |
otp: 26.1 | |
lint: lint | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.pair.elixir }} | |
otp-version: ${{ matrix.pair.otp }} | |
- name: Restore deps cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
deps | |
_build | |
key: deps-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }} | |
restore-keys: | | |
deps-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('**/mix.lock') }} | |
deps-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }} | |
- name: Create dializer plts path | |
run: mkdir -p priv/plts | |
- name: Restore plts cache | |
uses: actions/cache@v3 | |
with: | |
path: priv/plts | |
key: plts-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }} | |
restore-keys: | | |
plts-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('**/mix.lock') }} | |
plts-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }} | |
- name: Install package dependencies | |
run: mix deps.get | |
- name: Check code format | |
run: mix format --check-formatted | |
if: ${{ matrix.lint }} | |
- name: Check unused deps | |
run: mix deps.unlock --check-unused | |
if: ${{ matrix.lint }} | |
- name: Compile dependencies | |
run: mix deps.compile | |
env: | |
MIX_ENV: test | |
- name: Compile app | |
run: mix compile --warnings-as-errors | |
env: | |
MIX_ENV: test | |
if: ${{ matrix.lint }} | |
- name: Run unit tests | |
run: | | |
mix ecto.setup | |
mix test | |
env: | |
MIX_ENV: test | |
- name: Run dialyzer | |
run: mix dialyzer | |
if: ${{ matrix.lint }} |