Skip to content

Commit e0919ed

Browse files
committed
chore: integrate ci checks
1 parent 0d66d9e commit e0919ed

File tree

5 files changed

+105
-5
lines changed

5 files changed

+105
-5
lines changed

.github/workflows/formatting.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Formatting
2+
on:
3+
push:
4+
branches: ["main"]
5+
pull_request:
6+
branches: ["main"]
7+
permissions:
8+
contents: read
9+
jobs:
10+
formatting:
11+
permissions:
12+
contents: read
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: erlef/setup-beam@v1
17+
with:
18+
otp-version: "27"
19+
elixir-version: "1.18.4"
20+
- name: get dependencies
21+
run: mix deps.get
22+
- name: check formatting
23+
run: mix format --check-formatted

.github/workflows/linting.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Linting
2+
on:
3+
push:
4+
branches: ["main"]
5+
pull_request:
6+
branches: ["main"]
7+
permissions:
8+
contents: read
9+
jobs:
10+
credo:
11+
permissions:
12+
contents: read
13+
security-events: write
14+
actions: read
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: erlef/setup-beam@v1
19+
with:
20+
otp-version: "27"
21+
elixir-version: "1.18.4"
22+
- name: get dependencies
23+
run: mix deps.get
24+
- name: compile dependencies
25+
run: mix deps.compile
26+
- name: compile
27+
run: mix compile --warnings-as-errors
28+
- name: credo
29+
run: mix credo --format=sarif > credo_output.sarif
30+
- name: upload sarif
31+
uses: github/codeql-action/upload-sarif@v3
32+
with:
33+
sarif_file: credo_output.sarif

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Test
2+
on:
3+
push:
4+
branches: ["main"]
5+
pull_request:
6+
branches: ["main"]
7+
permissions:
8+
contents: read
9+
jobs:
10+
test:
11+
permissions:
12+
contents: read
13+
runs-on: ubuntu-latest
14+
services:
15+
postgres:
16+
image: postgres:17
17+
ports:
18+
- 5432:5432
19+
env:
20+
POSTGRES_USER: postgres
21+
POSTGRES_PASSWORD: postgres
22+
options: >-
23+
--health-cmd pg_isready
24+
--health-interval 10s
25+
--health-timeout 5s
26+
--health-retries 5
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: erlef/setup-beam@v1
30+
with:
31+
otp-version: "27"
32+
elixir-version: "1.18.4"
33+
- name: get dependencies
34+
run: mix deps.get
35+
- name: compile dependencies
36+
run: MIX_ENV=test mix deps.compile
37+
- name: compile
38+
run: MIX_ENV=test mix compile --warnings-as-errors
39+
- name: run tests
40+
run: mix test

config/dev.exs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ config :swoosh, :api_client, false
8484
# retries: 2,
8585
# no_mx_lookups: false
8686

87-
# Import dev local env specific config. This must remain at the bottom
88-
# of this file so it overrides the configuration defined above.
89-
import_config "dev.local.exs"
90-
9187
# Configure CQRS
9288
config :reply_express, ReplyExpress.Commanded,
9389
event_store: [
@@ -101,3 +97,9 @@ config :reply_express, ReplyExpress.EventStore,
10197
column_data_type: "jsonb",
10298
serializer: EventStore.JsonbSerializer,
10399
types: EventStore.PostgresTypes
100+
101+
# Import dev local env specific config. This must remain at the bottom
102+
# of this file so it overrides the configuration defined above.
103+
if File.exists?("dev.local.exs") do
104+
import_config "dev.local.exs"
105+
end

mix.exs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defmodule ReplyExpress.MixProject do
99
[
1010
app: :reply_express,
1111
version: "0.1.0",
12-
elixir: "~> 1.14",
12+
elixir: "~> 1.18",
1313
elixirc_paths: elixirc_paths(Mix.env()),
1414
start_permanent: Mix.env() == :prod,
1515
aliases: aliases(),
@@ -86,6 +86,8 @@ defmodule ReplyExpress.MixProject do
8686
"reset.test": ["eventstore.reset.test", "ecto.reset.test"],
8787
setup: ["deps.get", "ecto.setup"],
8888
test: [
89+
"event_store.create --quiet",
90+
"event_store.init --quiet",
8991
"ecto.create --quiet",
9092
"ecto.migrate --quiet",
9193
"test"

0 commit comments

Comments
 (0)