diff --git a/.github/actions/action.yml b/.github/actions/action.yml index 977c3ebef..c2601e91c 100644 --- a/.github/actions/action.yml +++ b/.github/actions/action.yml @@ -56,6 +56,7 @@ runs: key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '**/mix.lock')) }} restore-keys: | ${{ runner.os }}-mix- + - name: Get build cache uses: actions/cache@v3 id: build-cache @@ -98,4 +99,4 @@ runs: - name: Compile Application run: mix compile ${{ inputs.build-flags }} shell: sh - if: inputs.build-app == 'true' \ No newline at end of file + if: inputs.build-app == 'true' diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index c15b5217e..e80846ed5 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -8,7 +8,7 @@ on: jobs: style: runs-on: ubuntu-latest - name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} + name: Code Quality strategy: matrix: @@ -26,5 +26,8 @@ jobs: elixir-version: ${{ matrix.elixir }} build-flags: --all-warnings --warnings-as-errors - - name: Check code formating + - name: 🎨 Check code formating run: mix format --check-formatted + + - name: 🔍 Lint the code + run: mix credo --all --strict diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e7ec6f9ed..95eace5d0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,3 @@ - name: Build and Test on: @@ -14,10 +13,12 @@ jobs: name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} env: MIX_ENV: test + strategy: matrix: otp: [25.x] elixir: [1.14.x] + services: db: image: postgres:14.1 @@ -29,17 +30,17 @@ jobs: POSTGRES_HOSTNAME: 0.0.0.0 steps: - - name: Checkout repository + - name: ☁️ Checkout repository uses: actions/checkout@v3 - - name: Setup Elixir ${{ matrix.elixir }} (OTP ${{matrix.otp}}) + - name: 💧 Setup Elixir ${{ matrix.elixir }} (OTP ${{matrix.otp}}) uses: ./.github/actions with: otp-version: ${{ matrix.otp }} elixir-version: ${{ matrix.elixir }} build-flags: --all-warnings --warnings-as-errors - - name: Install wkhtmltopdf + - name: ⚙️ Install wkhtmltopdf run: sudo apt-get update && sudo apt-get install -y wkhtmltopdf - name: 🔬 Run the tests diff --git a/lib/atomic_web/live/partner_live/index.ex b/lib/atomic_web/live/partner_live/index.ex index 9340dd9d6..2cb8ccdc1 100644 --- a/lib/atomic_web/live/partner_live/index.ex +++ b/lib/atomic_web/live/partner_live/index.ex @@ -2,8 +2,8 @@ defmodule AtomicWeb.PartnerLive.Index do use AtomicWeb, :live_view alias Atomic.Organizations - alias Atomic.Partnerships alias Atomic.Organizations.Partner + alias Atomic.Partnerships @impl true def mount(%{"organization_id" => organization_id}, _session, socket) do diff --git a/test/atomic/partnerships_test.exs b/test/atomic/partnerships_test.exs index 72fa0abdd..40e869612 100644 --- a/test/atomic/partnerships_test.exs +++ b/test/atomic/partnerships_test.exs @@ -4,8 +4,8 @@ defmodule Atomic.PartnershipsTest do alias Atomic.Partnerships describe "partnerships" do - alias Atomic.OrganizationsFixtures alias Atomic.Organizations.Partner + alias Atomic.OrganizationsFixtures import Atomic.PartnershipsFixtures @invalid_attrs %{description: nil, name: nil}