Add unit tests for code coverage and fix bugs #6
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: EctoModel | CI checks | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ci-${{github.ref}} | |
cancel-in-progress: true | |
jobs: | |
lint-and-test: | |
runs-on: ubuntu-latest | |
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} | |
strategy: | |
matrix: | |
include: | |
- otp: "26.1" | |
elixir: "1.15.7" | |
- otp: "24.2" | |
elixir: "1.13.4" | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: ecto_model_repo | |
POSTGRES_PORT: 5432 | |
steps: | |
- name: Checkout Github repo | |
uses: actions/checkout@v3.0.2 | |
- name: Setup BEAM Env | |
uses: erlef/setup-beam@v1.15 | |
with: | |
otp-version: ${{matrix.otp}} | |
elixir-version: ${{matrix.elixir}} | |
- name: Setup Cache | |
uses: actions/cache@v3.0.4 | |
id: mix-cache | |
with: | |
path: | | |
deps | |
_build | |
priv/plts | |
key: ${{ hashFiles('mix.lock') }}-${{ matrix.elixir }}-${{ matrix.otp }} | |
- if: steps.mix-cache.outputs.cache-hit != 'true' | |
run: mkdir -p priv/plts; mix deps.get; mix deps.compile | |
- run: docker-compose up -d | |
- run: mix lint | |
- run: MIX_ENV=test mix do ecto.create, ecto.migrate, test |