Skip to content

Commit

Permalink
ci: improve style workflow (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruilopesm authored Aug 18, 2023
1 parent c488a03 commit 9f72d28
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/actions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -98,4 +99,4 @@ runs:
- name: Compile Application
run: mix compile ${{ inputs.build-flags }}
shell: sh
if: inputs.build-app == 'true'
if: inputs.build-app == 'true'
7 changes: 5 additions & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
style:
runs-on: ubuntu-latest
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
name: Code Quality

strategy:
matrix:
Expand All @@ -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
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Build and Test

on:
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/atomic_web/live/partner_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/atomic/partnerships_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 9f72d28

Please sign in to comment.