diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5e05964 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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}} \ No newline at end of file diff --git a/DELETEME b/DELETEME new file mode 100644 index 0000000..4648beb --- /dev/null +++ b/DELETEME @@ -0,0 +1 @@ +DELETEME diff --git a/test/support/data_case.ex b/test/support/data_case.ex index c1118ab..60de1d5 100644 --- a/test/support/data_case.ex +++ b/test/support/data_case.ex @@ -15,6 +15,7 @@ defmodule WomenInTechVic.DataCase do """ use ExUnit.CaseTemplate + alias Ecto.Adapters.SQL.Sandbox using do quote do @@ -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 """