-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (62 loc) · 1.53 KB
/
elixir_ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Elixir CI
on:
push:
branches:
- main
- "release/*"
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: book_my_gigs_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
MIX_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost/book_my_gigs_test
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Cache Elixir dependencies
uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-
- name: Set up Elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: 1.15.7
otp-version: 26.0
- name: Install dependencies
run: mix deps.get
- name: Format Elixir code
run: mix format
- name: Setup database
run: |
mix ecto.create
mix ecto.migrate
- name: Run Credo
run: |
echo "Running Credo:"
mix credo
- name: List test files
run: |
echo "Listing test files:"
ls -l test
- name: Run tests with ExCoveralls
run: mix coveralls