-
Notifications
You must be signed in to change notification settings - Fork 1
110 lines (92 loc) · 2.74 KB
/
ci.yml
File metadata and controls
110 lines (92 loc) · 2.74 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: CI
on:
pull_request:
workflow_dispatch:
push:
branches:
- main
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
permissions:
checks: write
name: OTP ${{ matrix.otp }} / rebar3 ${{ matrix.rebar3 }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Latest - run all checks
- otp: '28.1'
rebar3: '3.25.0'
lint: true
dialyzer: true
coverage: true
# Stable
- otp: '27.2'
rebar3: '3.25.0'
# Minimum supported
- otp: '25.3'
rebar3: '3.24.0'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Erlang/OTP
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
rebar3-version: ${{ matrix.rebar3 }}
- name: Cache dependencies
uses: actions/cache@v4
with:
path: _build/default/lib
key: deps-${{ runner.os }}-otp-${{ matrix.otp }}-${{ hashFiles('rebar.lock') }}
restore-keys: |
deps-${{ runner.os }}-otp-${{ matrix.otp }}-
- name: Cache PLTs
uses: actions/cache@v4
if: ${{ matrix.dialyzer }}
with:
path: _build/*/rebar3_*_plt
key: plt-${{ runner.os }}-otp-${{ matrix.otp }}-${{ hashFiles('rebar.lock') }}
restore-keys: |
plt-${{ runner.os }}-otp-${{ matrix.otp }}-
- name: Compile
run: rebar3 compile
- name: Check formatting
if: ${{ matrix.lint }}
run: rebar3 fmt --check
- name: Run xref
if: ${{ matrix.lint }}
run: rebar3 xref
- name: Run dialyzer
if: ${{ matrix.dialyzer }}
run: rebar3 dialyzer
- name: Install nghttpx
run: sudo apt-get update && sudo apt-get install -y nghttp2
- name: Run tests
id: test
run: rebar3 test
- name: Upload CT logs on failure
if: ${{ failure() && steps.test.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: ct-logs-otp-${{ matrix.otp }}
path: _build/test/logs
- name: Generate coverage report
if: ${{ matrix.coverage }}
run: rebar3 covertool generate
- name: Upload coverage to Codecov
if: ${{ matrix.coverage }}
uses: codecov/codecov-action@v5.5.2
with:
files: _build/test/covertool/gen_http.covertool.xml
fail_ci_if_error: true
flags: erlang-${{ matrix.otp }}
name: Erlang/OTP ${{ matrix.otp }}
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}