-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (70 loc) · 2.37 KB
/
ci.yaml
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
76
77
78
name: Continuous integration
on:
push:
branches: ["*"]
tags: ["v*"]
pull_request:
branches: ["develop"]
jobs:
test:
# runs-on: ubuntu-latest
runs-on: ubuntu-20.04
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:3.8
env:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- 5672:5672
strategy:
matrix:
include:
# # Drop old builds for now while fixing the new ones
# # This is what docker builds.
# - elixir-version: "1.9"
# otp-version: "21"
# Current (at time of writing) versions.
- elixir-version: "1.17"
otp-version: "27"
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
id: beam
with:
elixir-version: ${{ matrix.elixir-version }}
otp-version: ${{ matrix.otp-version }}
- name: Fetch deps
run: |
mix deps.get
- name: Compile prometheus_process_collector
run: |
# The prometheus_process_collector's makefile doesn't work properly
# for new OTP, so we set the variables it needs in a way that works.
export ERTS_INCLUDE_DIR=$(erl -noshell -eval "io:format(\"~s/erts-~s/include/\", [code:root_dir(), erlang:system_info(version)])." -s init stop)
export ERL_INTERFACE_INCLUDE_DIR=$(erl -noshell -eval "io:format(\"~s\", [code:lib_dir(erl_interface, include)])." -s init stop)
export ERL_INTERFACE_LIB_DIR=$(erl -noshell -eval "io:format(\"~s\", [code:lib_dir(erl_interface, lib)])." -s init stop)
MIX_ENV=test mix deps.compile prometheus_process_collector
- name: Run tests
run: |
# This is basically `mix test` with coverage enabled.
mix coveralls.json
- name: Lints
# Let the build succeed for now even if the lints fail.
continue-on-error: true
run: |
mix format --check-formatted
# This will mention FIXME and TODO comments without failing, any
# other issue fails the build.
mix credo