Skip to content

Commit

Permalink
add ci and dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
CorneliaKelinske committed Jul 31, 2024
1 parent 8f04538 commit a141ca8
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 3 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: CI
on: [push, pull_request]

jobs:
credo:
name: Credo
runs-on: ubuntu-latest
services:
db:
image: postgres:16.3
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: postgres
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
deps
_build
key: ${{ runner.os }}-credo-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-credo-
- uses: erlef/setup-beam@v1
with:
otp-version: 27.0
elixir-version: 1.17
- run: mix deps.get
- run: mix credo --strict

dialyzer:
name: Dialyzer
runs-on: ubuntu-latest
services:
db:
image: postgres:16.3
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: postgres
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
deps
_build
dialyzer
key: ${{ runner.os }}-dialyzer-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-dialyzer-
- uses: erlef/setup-beam@v1
with:
otp-version: 27.0.1
elixir-version: 1.17
- run: mix deps.get
- run: mix dialyzer

coveralls:
name: Coveralls
runs-on: ubuntu-latest
services:
db:
image: postgres:16.3
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: postgres
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
deps
_build
key: ${{ runner.os }}-coveralls-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-coveralls-
- uses: erlef/setup-beam@v1
with:
otp-version: 27.0
elixir-version: 1.17
- run: mix deps.get
- run: mix coveralls.json
- name: Upload to codecov.io
uses: codecov/codecov-action@v1


1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ npm-debug.log

.elixir-tools

*.plt
1 change: 1 addition & 0 deletions DELETEME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DELETEME
Binary file added dialyzer/dialyxir_erlang-27.0.1.plt
Binary file not shown.
Binary file added dialyzer/dialyxir_erlang-27.0.1_elixir-1.17.2.plt
Binary file not shown.
Binary file not shown.
5 changes: 3 additions & 2 deletions test/support/data_case.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ defmodule WomenInTechVic.DataCase do
"""

use ExUnit.CaseTemplate
alias Ecto.Adapters.SQL.Sandbox

using do
quote do
Expand All @@ -36,8 +37,8 @@ defmodule WomenInTechVic.DataCase do
Sets up the sandbox based on the test tags.
"""
def setup_sandbox(tags) do
pid = Ecto.Adapters.SQL.Sandbox.start_owner!(WomenInTechVic.Repo, shared: not tags[:async])
on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
pid = Sandbox.start_owner!(WomenInTechVic.Repo, shared: not tags[:async])
on_exit(fn -> Sandbox.stop_owner(pid) end)
end

@doc """
Expand Down

0 comments on commit a141ca8

Please sign in to comment.