Skip to content

Commit c6d528a

Browse files
committed
add gh actions workflow
1 parent de3f160 commit c6d528a

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

.github/workflows/ci.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
15+
strategy:
16+
matrix:
17+
otp: ["24.3", "25.1"]
18+
elixir: ["1.13", "1.14"]
19+
exclude:
20+
- otp: "25.1"
21+
elixir: "1.13"
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
25+
services:
26+
postgres:
27+
image: postgres:12-alpine
28+
env:
29+
POSTGRES_USER: postgres
30+
POSTGRES_PASSWORD: postgres
31+
options: >-
32+
--health-cmd pg_isready
33+
--health-interval 10s
34+
--health-timeout 5s
35+
--health-retries 5
36+
ports:
37+
- 5432:5432
38+
39+
steps:
40+
- uses: actions/checkout@v3
41+
- uses: erlef/setup-beam@v1
42+
with:
43+
otp-version: ${{matrix.otp}}
44+
elixir-version: ${{matrix.elixir}}
45+
- name: Restore dependencies and build cache
46+
uses: actions/cache@v3
47+
with:
48+
path: |
49+
_build
50+
deps
51+
key: ${{ runner.os }}-otp-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-mix-${{ hashFiles('mix.lock') }}
52+
restore-keys: ${{ runner.os }}-otp-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-
53+
- name: Restore PLT cache
54+
uses: actions/cache@v3
55+
id: plt_cache
56+
with:
57+
key: |
58+
${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-plt-${{ hashFiles('mix.lock') }}
59+
restore-keys: |
60+
${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-plt-
61+
path: |
62+
.plts
63+
- name: Install Dependencies
64+
run: |
65+
mix local.rebar --force
66+
mix local.hex --force
67+
mix deps.get
68+
- name: Run Formatter
69+
run: mix format --check-formatted
70+
- name: Compile
71+
run: mix compile --warnings-as-errors
72+
# - name: Run Linter
73+
# run: mix credo
74+
- name: Run Hex Audit
75+
run: mix hex.audit
76+
- name: Generate docs
77+
run: mix docs
78+
- name: Run Tests
79+
run: mix coveralls.github

0 commit comments

Comments
 (0)