-
Notifications
You must be signed in to change notification settings - Fork 120
82 lines (79 loc) · 2.62 KB
/
main.yml
File metadata and controls
82 lines (79 loc) · 2.62 KB
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
79
80
81
82
name: main
on:
push:
branches:
- master
pull_request:
branches:
- "*"
workflow_dispatch: {}
jobs:
test:
name: OTP ${{matrix.otp}} - rebar3 ${{matrix.rebar3}}
strategy:
matrix:
otp: ['28', '27', '26']
rebar3: ['3.27']
runs-on: 'ubuntu-24.04'
steps:
- uses: actions/checkout@v6
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar3}}
- run: rebar3 compile
- run: rebar3 fmt --check
if: ${{ matrix.otp == '28' }}
- run: rebar3 lint
- run: rebar3 xref
- run: rebar3 dialyzer
- run: rebar3 eunit
- run: rebar3 ex_doc
- run: rebar3 do cover, covertool generate
if: ${{ matrix.otp == '28' }}
- name: Upload code coverage
uses: codecov/codecov-action@v5
if: ${{ matrix.otp == '28' }}
with:
files: _build/test/covertool/prometheus.covertool.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
promtool:
name: promtool
runs-on: 'ubuntu-24.04'
steps:
- uses: actions/setup-go@v6
with:
go-version: 'stable'
- run: |
# Fetch latest version
TAG=$(curl -s https://api.github.com/repos/prometheus/prometheus/releases | jq -r '.[] | .tag_name' | head -n 1)
echo $TAG
# Remove the `v` prefix
VERSION=$(echo $TAG | sed 's/v//')
echo $VERSION
# Check CPU architecture
ARCH=$(uname -s | tr A-Z a-z)-$(uname -m | sed 's/x86_64/amd64/')
echo $ARCH
# Download the release
curl -L -O https://github.com/prometheus/prometheus/releases/download/$TAG/prometheus-$VERSION.$ARCH.tar.gz
# Extract the file
tar -xvzf prometheus-$VERSION.$ARCH.tar.gz
# Move promtool
mv prometheus-$VERSION.$ARCH/promtool /usr/local/bin
# Verify if promtool is installed
promtool --version
# Delete downloaded files
rm -rf prometheus-$VERSION.$ARCH
rm -rf prometheus-$VERSION.$ARCH.tar.gz
- uses: actions/checkout@v6
- uses: erlef/setup-beam@v1
with:
otp-version: '28'
rebar3-version: '3.27'
- run: rebar3 compile
- run: |
set -e
set -o pipefail
erl -pa _build/default/lib/prometheus/ebin -pa _build/default/lib/ddskerl/ebin -noshell -eval '{ok, _} = application:ensure_all_started(prometheus), ok = io:format(standard_io, "~s~n", [prometheus_text_format:format()]), halt().' | promtool check metrics