diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..628960b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,65 @@ +name: Test + +on: + pull_request: + push: + branches: + - main +env: + otp: "26.2.2" + elixir: "1.16.1" + MIX_ENV: test + +jobs: + main: + runs-on: ubuntu-latest + + services: + db: + image: postgres:16.2 + ports: ["5432:5432"] + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - uses: actions/checkout@v4 + + - name: Install Erlang & Elixir + uses: erlef/setup-beam@v1 + with: + otp-version: ${{ env.otp }} + elixir-version: ${{ env.elixir }} + version-type: strict + + - name: Cache Mix + uses: actions/cache@v4 + with: + path: | + deps + _build + key: ${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}-${{ hashFiles('**/mix.lock') }} + restore-keys: | + ${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}- + + - name: Install mix dependencies + run: mix deps.get --check-locked + + - name: Check formatting + run: mix format --check-formatted + + - name: Compile dependencies + run: mix deps.compile + + - name: Check warnings + run: mix compile --warnings-as-errors --force + + - name: Setup database + run: mix do ecto.create, ecto.migrate + + - name: Run tests + run: mix test --warnings-as-errors diff --git a/lib/search_web/components/core_components.ex b/lib/search_web/components/core_components.ex index 4f86160..c060ea5 100644 --- a/lib/search_web/components/core_components.ex +++ b/lib/search_web/components/core_components.ex @@ -156,8 +156,7 @@ defmodule SearchWeb.CoreComponents do phx-connected={hide("#client-error")} hidden > - Attempting to reconnect - <.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" /> + Attempting to reconnect <.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" /> <.flash diff --git a/mix.lock b/mix.lock index 73205fb..28adb47 100644 --- a/mix.lock +++ b/mix.lock @@ -9,7 +9,7 @@ "esbuild": {:hex, :esbuild, "0.8.1", "0cbf919f0eccb136d2eeef0df49c4acf55336de864e63594adcea3814f3edf41", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "25fc876a67c13cb0a776e7b5d7974851556baeda2085296c14ab48555ea7560f"}, "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, "floki": {:hex, :floki, "0.35.4", "cc947b446024732c07274ac656600c5c4dc014caa1f8fb2dfff93d275b83890d", [:mix], [], "hexpm", "27fa185d3469bd8fc5947ef0f8d5c4e47f0af02eb6b070b63c868f69e3af0204"}, - "heroicons": {:git, "https://github.com/tailwindlabs/heroicons.git", "88ab3a0d790e6a47404cba02800a6b25d2afae50", [tag: "v2.1.1", sparse: "optimized", depth: 1]}, + "heroicons": {:git, "https://github.com/tailwindlabs/heroicons.git", "88ab3a0d790e6a47404cba02800a6b25d2afae50", [tag: "v2.1.1", sparse: "optimized"]}, "hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"}, "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, "mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"},