Skip to content

Commit 49cf3d7

Browse files
committed
Create ci.yml
1 parent def5adb commit 49cf3d7

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/ci.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
test:
13+
14+
name: Build and test
15+
runs-on: ubuntu-latest
16+
env:
17+
MIX_ENV: test
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- pair:
23+
elixir: "1.16.3"
24+
otp: "26.2.5.3"
25+
- pair:
26+
elixir: "1.17.3"
27+
otp: "27.1"
28+
lint: lint
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Set up Elixir
32+
uses: erlef/setup-beam@main
33+
with:
34+
otp-version: ${{ matrix.pair.otp }}
35+
elixir-version: ${{ matrix.pair.elixir }}
36+
version-type: strict
37+
- name: Restore dependencies cache
38+
uses: actions/cache@v4
39+
with:
40+
path: deps
41+
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
42+
restore-keys: ${{ runner.os }}-mix-
43+
- run: mix deps.get --check-locked
44+
- run: mix format --check-formatted
45+
if: ${{ matrix.lint }}
46+
- run: mix deps.unlock --check-unused
47+
if: ${{ matrix.lint }}
48+
- run: mix deps.compile
49+
- run: mix compile --no-optional-deps --warnings-as-errors
50+
if: ${{ matrix.lint }}
51+
- run: mix test --slowest 5
52+
if: ${{ ! matrix.lint }}
53+
- run: mix test --slowest 5 --warnings-as-errors
54+
if: ${{ matrix.lint }}

0 commit comments

Comments
 (0)