Skip to content

Commit b044903

Browse files
committed
ci: 👷 add Elixir CI
1 parent 59e1dcc commit b044903

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

.github/workflows/elixir.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Elixir CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- ".github/workflows/*"
9+
- "**/*.ex"
10+
- "**/*.exs"
11+
- "**/*.eex"
12+
- "mix.lock"
13+
pull_request:
14+
branches:
15+
- master
16+
paths:
17+
- ".github/workflows/*"
18+
- "**/*.ex"
19+
- "**/*.exs"
20+
- "**/*.eex"
21+
- "mix.lock"
22+
23+
jobs:
24+
lint:
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Set up Elixir
32+
uses: erlef/setup-beam@v1
33+
with:
34+
otp-version: '27.0.1'
35+
elixir-version: '1.17.2'
36+
37+
- name: Restore deps cache
38+
uses: actions/cache@v4
39+
with:
40+
path: |
41+
deps
42+
_build
43+
key: ${{ runner.os }}-deps-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }}
44+
restore-keys: |
45+
${{ runner.os }}-deps-${{ hashFiles('**/mix.lock') }}
46+
${{ runner.os }}-deps
47+
48+
- name: Install package dependencies
49+
run: mix deps.get
50+
51+
- name: Remove compiled application files
52+
run: mix clean
53+
54+
- name: Compile dependencies
55+
run: mix compile
56+
env:
57+
MIX_ENV: test
58+
59+
- name: Run tests
60+
run: mix test --trace
61+
env:
62+
MIX_ENV: test
63+
64+
- name: Check code coverage
65+
run: mix coveralls
66+
env:
67+
MIX_ENV: test
68+
69+
- name: Upload coverage to coveralls
70+
run: mix coveralls.github
71+
env:
72+
MIX_ENV: test
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
75+
- name: Check code formatting
76+
run: mix check
77+
78+
- name: Run Credo linter
79+
run: mix credo --strict

0 commit comments

Comments
 (0)