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 6f04fc7
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 2 deletions.
141 changes: 141 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
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

doctor:
name: Doctor
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 doctor

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
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

auto-merge:
name: Auto-merge
if: ${{ github.event_name == 'pull_request'}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
target: minor
github-token: ${{ secrets.MYTOKEN}}
1 change: 1 addition & 0 deletions DELETEME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DELETEME
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 6f04fc7

Please sign in to comment.