Skip to content

Commit 80bf1c6

Browse files
authored
chore: add a bunch of checks to gh actions (#2)
1 parent 49192a3 commit 80bf1c6

File tree

9 files changed

+197
-29
lines changed

9 files changed

+197
-29
lines changed

.github/workflows/coverage.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Coverage
2+
3+
on: push
4+
5+
jobs:
6+
Coverage:
7+
runs-on: ubuntu-latest
8+
9+
container:
10+
image: mikaak/elixir:1.13-alpine
11+
env:
12+
MIX_ENV: test
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Install Rebar & Hex
18+
run: mix local.hex --force && mix local.rebar --force
19+
20+
- name: Install Tar
21+
run: apk add --no-cache tar
22+
23+
- name: Cache Deps & Build
24+
uses: actions/cache@v2
25+
with:
26+
key: ${{github.ref}}-deps-build-cache
27+
path: |
28+
./deps
29+
./_build
30+
!._build/dev/lib/error_message/
31+
32+
- name: Install Dependencies
33+
run: mix deps.get
34+
35+
- name: Compile Project
36+
run: mix compile
37+
38+
- name: Run Coveralls
39+
run: mix coveralls.json
40+
41+
- name: Upload to codecov.io
42+
uses: codecov/codecov-action@v1

.github/workflows/credo.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Credo
2+
3+
on: push
4+
5+
jobs:
6+
Credo:
7+
runs-on: ubuntu-latest
8+
9+
container:
10+
image: mikaak/elixir:1.13-alpine
11+
env:
12+
MIX_ENV: test
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Install Rebar & Hex
18+
run: mix local.hex --force && mix local.rebar --force
19+
20+
- name: Install Tar
21+
run: apk add --no-cache tar
22+
23+
- name: Cache Deps & Build
24+
uses: actions/cache@v2
25+
with:
26+
key: ${{github.ref}}-deps-build-cache
27+
path: |
28+
./deps
29+
./_build
30+
!._build/dev/lib/error_message/
31+
32+
- name: Install Dependencies
33+
run: mix deps.get
34+
35+
- name: Compile Project
36+
run: mix compile
37+
38+
- name: Run Credo
39+
run: mix credo

.github/workflows/dialyzer.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Dialyzer
2+
3+
on: push
4+
5+
jobs:
6+
Dialyzer:
7+
runs-on: ubuntu-latest
8+
9+
container:
10+
image: mikaak/elixir:1.13-alpine
11+
env:
12+
MIX_ENV: test
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Install Rebar & Hex
18+
run: mix local.hex --force && mix local.rebar --force
19+
20+
- name: Install Tar
21+
run: apk add --no-cache tar
22+
23+
- name: Cache Deps & Build
24+
uses: actions/cache@v2
25+
with:
26+
key: ${{ runner.os }}-mix-dialyzer-${{ hashFiles('**/mix.lock') }}
27+
path: |
28+
deps
29+
_build
30+
dialyzer
31+
!._build/dev/lib/error_message/
32+
restore-keys: |
33+
${{ runner.os }}-mix-dialyzer-
34+
35+
- name: Install Dependencies
36+
run: mix deps.get
37+
38+
- name: Compile Project
39+
run: mix compile
40+
41+
- name: Run Dialyzer
42+
run: mix dialyzer
43+
44+

.github/workflows/test-actions.yml .github/workflows/test.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Test
22

3-
on: [push, pull_request]
3+
on: push
44

55
jobs:
66
Test:
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v2
1616

1717
- name: Install Rebar & Hex
18-
run: mix local.hex --force --if-missing && mix local.rebar --force --if-missing
18+
run: mix local.hex --force && mix local.rebar --force
1919

2020
- name: Install Tar
2121
run: apk add --no-cache tar
@@ -28,6 +28,7 @@ jobs:
2828
./deps
2929
./_build
3030
!._build/dev/lib/error_message/
31+
3132
- name: Install Dependencies
3233
run: mix deps.get
3334

.gitignore

+37-22
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,41 @@
1-
# The directory Mix will write compiled artifacts to.
2-
/_build/
3-
4-
# If you run "mix test --cover", coverage assets end up here.
5-
/cover/
6-
7-
# The directory Mix downloads your dependencies sources to.
8-
/deps/
9-
10-
# Where third-party dependencies like ExDoc output generated docs.
11-
/doc/
12-
13-
# Ignore .fetch files in case you like to edit your project deps locally.
1+
/_build
2+
/cover
3+
/deps
4+
/doc
145
/.fetch
15-
16-
# If the VM crashes, it generates a dump, let's ignore it too.
176
erl_crash.dump
18-
19-
# Also ignore archive artifacts (built via "mix archive.build").
207
*.ez
8+
*.beam
9+
/config/*.secret.exs
10+
.elixir_ls/
11+
12+
### Elixir Patch ###
13+
14+
### OSX ###
15+
# General
16+
.DS_Store
17+
.AppleDouble
18+
.LSOverride
19+
20+
# Icon must end with two \r
21+
Icon
22+
23+
# Thumbnails
24+
._*
25+
26+
# Files that might appear in the root of a volume
27+
.DocumentRevisions-V100
28+
.fseventsd
29+
.Spotlight-V100
30+
.TemporaryItems
31+
.Trashes
32+
.VolumeIcon.icns
33+
.com.apple.timemachine.donotpresent
34+
35+
# Directories potentially created on remote AFP share
36+
.AppleDB
37+
.AppleDesktop
38+
Network Trash Folder
39+
Temporary Items
40+
.apdisk
2141

22-
# Ignore package tarball (built via "mix hex.build").
23-
ex_factory-*.tar
24-
25-
# Temporary files, for example, from tests.
26-
/tmp/

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# FactoryEx
2-
3-
[![Test](https://github.com/theblitzapp/factory_ex/actions/workflows/test-actions.yml/badge.svg)](https://github.com/theblitzapp/factory_ex/actions/workflows/test-actions.yml)
2+
[![Coverage](https://github.com/MikaAK/factory_ex/actions/workflows/coverage.yml/badge.svg)](https://github.com/MikaAK/factory_ex/actions/workflows/coverage.yml)
3+
[![Test](https://github.com/MikaAK/factory_ex/actions/workflows/test.yml/badge.svg)](https://github.com/MikaAK/factory_ex/actions/workflows/test.yml)
4+
[![Dialyzer](https://github.com/MikaAK/factory_ex/actions/workflows/dialyzer.yml/badge.svg)](https://github.com/MikaAK/factory_ex/actions/workflows/dialyzer.yml)
5+
[![Credo](https://github.com/MikaAK/factory_ex/actions/workflows/credo.yml/badge.svg)](https://github.com/MikaAK/factory_ex/actions/workflows/credo.yml)
6+
[![codecov](https://codecov.io/gh/MikaAK/factory_ex/branch/master/graph/badge.svg?token=V0JJA5AZ1H)](https://codecov.io/gh/MikaAK/factory_ex)
47
[![Hex version badge](https://img.shields.io/hexpm/v/factory_ex.svg)](https://hex.pm/packages/factory_ex)
58

69
### Installation

dialyzer/.gitkeep

Whitespace-only changes.

lib/factory_ex/utils.ex

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
defmodule FactoryEx.Utils do
2+
@moduledoc false
3+
24
@struct_fields [:__meta__]
35
@whitelisted_modules [DateTime]
46

mix.exs

+25-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,22 @@ defmodule FactoryEx.MixProject do
1111
start_permanent: Mix.env() == :prod,
1212
deps: deps(),
1313
docs: docs(),
14-
package: package()
14+
package: package(),
15+
test_coverage: [tool: ExCoveralls],
16+
dialyzer: [
17+
plt_add_apps: [:ex_unit, :mix, :credo],
18+
list_unused_filters: true,
19+
plt_local_path: "dialyzer",
20+
plt_core_path: "dialyzer",
21+
flags: [:unmatched_returns]
22+
],
23+
preferred_cli_env: [
24+
dialyzer: :test,
25+
coveralls: :test,
26+
"coveralls.detail": :test,
27+
"coveralls.post": :test,
28+
"coveralls.html": :test
29+
]
1530
]
1631
end
1732

@@ -25,9 +40,16 @@ defmodule FactoryEx.MixProject do
2540
# Run "mix help deps" to learn about dependencies.
2641
defp deps do
2742
[
28-
{:ecto, "~> 3.0", only: [:test, :dev], optional: true},
43+
{:ecto, "~> 3.0"},
2944
{:ecto_sql, "~> 3.0", only: [:test, :dev], optional: true},
30-
{:postgrex, "~> 0.16", only: [:test, :dev], optional: true}
45+
{:postgrex, "~> 0.16", only: [:test, :dev], optional: true},
46+
47+
{:credo, "~> 1.6", only: [:test, :dev], runtime: false},
48+
{:blitz_credo_checks, "~> 0.1", only: [:test, :dev], runtime: false},
49+
50+
{:excoveralls, "~> 0.10", only: :test},
51+
{:ex_doc, ">= 0.0.0", optional: true, only: :dev},
52+
{:dialyxir, "~> 1.0", optional: true, only: :test, runtime: false}
3153
]
3254
end
3355

0 commit comments

Comments
 (0)